From 537ad1c1e5453dc3b4a27bc904ba1fc7106df3b9 Mon Sep 17 00:00:00 2001 From: SiriusXT <1160925501@qq.com> Date: Fri, 6 Jun 2025 15:55:00 +0800 Subject: [PATCH] fix(tab-row): Fix extra +1 when extraWidthRemaining is a decimal --- apps/client/src/widgets/tab_row.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/client/src/widgets/tab_row.ts b/apps/client/src/widgets/tab_row.ts index 26da432c2..6e212f6f6 100644 --- a/apps/client/src/widgets/tab_row.ts +++ b/apps/client/src/widgets/tab_row.ts @@ -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; } }