fix: control minimum width boundary

This commit is contained in:
Hufe921
2023-09-04 21:36:16 +08:00
parent 4b2bbfbe9a
commit 05caccc74c
+6 -2
View File
@@ -1322,8 +1322,12 @@ export class Draw {
const extraWidth = rowElement.control.minWidth - controlRealWidth const extraWidth = rowElement.control.minWidth - controlRealWidth
// 消费超出实际最小宽度的长度 // 消费超出实际最小宽度的长度
if (extraWidth > 0) { 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 { } else {
rowElement.left = 0 rowElement.left = 0
} }