mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 18:39:22 +08:00
fix(tab-row): Fix extra +1 when extraWidthRemaining is a decimal
This commit is contained in:
parent
a38c091d73
commit
537ad1c1e5
@ -510,11 +510,11 @@ export default class TabRowWidget extends BasicWidget {
|
||||
let extraWidthRemaining = totalExtraWidthDueToFlooring;
|
||||
|
||||
for (let i = 0; i < numberOfTabs; i += 1) {
|
||||
const extraWidth = flooredClampedTargetWidth < TAB_CONTAINER_MAX_WIDTH && extraWidthRemaining > 0 ? 1 : 0;
|
||||
const extraWidth = flooredClampedTargetWidth < TAB_CONTAINER_MAX_WIDTH && extraWidthRemaining >= 1 ? 1 : 0;
|
||||
|
||||
widths.push(flooredClampedTargetWidth + extraWidth);
|
||||
|
||||
if (extraWidthRemaining > 0) {
|
||||
if (extraWidthRemaining >= 1) {
|
||||
extraWidthRemaining -= 1;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user