From 05caccc74c7d723f4ac357d161acf45364368f4b Mon Sep 17 00:00:00 2001 From: Hufe921 Date: Mon, 4 Sep 2023 21:36:16 +0800 Subject: [PATCH] fix: control minimum width boundary --- src/editor/core/draw/Draw.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/editor/core/draw/Draw.ts b/src/editor/core/draw/Draw.ts index 7884928..e443840 100644 --- a/src/editor/core/draw/Draw.ts +++ b/src/editor/core/draw/Draw.ts @@ -1322,8 +1322,12 @@ export class Draw { const extraWidth = rowElement.control.minWidth - controlRealWidth // 消费超出实际最小宽度的长度 if (extraWidth > 0) { - rowElement.left = extraWidth - curRow.width += extraWidth + // 超出行宽时截断 + const rowRemainingWidth = + availableWidth - curRow.width - metrics.width + const left = Math.min(rowRemainingWidth, extraWidth) + rowElement.left = left + curRow.width += left } else { rowElement.left = 0 }