From 4b18e7dface7c7f548451963b6e8aee1d3149217 Mon Sep 17 00:00:00 2001 From: yulei Date: Wed, 21 Aug 2024 21:43:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=99=90=E5=AE=9A=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E8=A1=8CminHeight=E6=9C=80=E5=A4=A7=E4=B8=8D=E8=83=BD=E8=B6=85?= =?UTF-8?q?=E8=BF=87=E9=A1=B5=E9=9D=A2=E5=86=85=E5=AE=B9=E5=8C=BA=E5=9F=9F?= =?UTF-8?q?=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/editor/core/draw/Draw.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/editor/core/draw/Draw.ts b/src/editor/core/draw/Draw.ts index 2215167..98c29a1 100644 --- a/src/editor/core/draw/Draw.ts +++ b/src/editor/core/draw/Draw.ts @@ -1422,6 +1422,21 @@ export class Draw { }) } } + // 检查行的minHeight,最大只能为页面主内容区域高度 + const height = this.getHeight() + const marginHeight = this.getMainOuterHeight() + const emptyMainHeight = (height - marginHeight - rowMargin * 2) / scale + trList.forEach(tr => { + if (tr.minHeight && tr.minHeight > emptyMainHeight) { + const reduceHeight = tr.minHeight - emptyMainHeight + tr.height -= reduceHeight + tr.minHeight -= reduceHeight + tr.tdList.forEach(td => { + td.realMinHeight && (td.realMinHeight -= reduceHeight) + td.realHeight && (td.realHeight -= reduceHeight) + }) + } + }) // 需要重新计算表格内值 this.tableParticle.computeRowColInfo(element) // 计算出表格高度 @@ -1437,8 +1452,6 @@ export class Draw { metrics.boundingBoxAscent = -rowMargin // 表格分页处理(拆分表格) if (isPagingMode) { - const height = this.getHeight() - const marginHeight = this.getMainOuterHeight() let curPagePreHeight = marginHeight for (let r = 0; r < rowList.length; r++) { const row = rowList[r]