From 5d64f792797a4ac49f708a6ae8ad957e60e33811 Mon Sep 17 00:00:00 2001 From: Starryi Date: Mon, 12 Jul 2021 14:42:18 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-53175=E3=80=9010.0.18=E3=80=91=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E8=83=8C=E6=99=AF=E5=88=86=E7=A6=BB=E4=B8=BA=E6=A0=87?= =?UTF-8?q?=E9=A2=98/=E8=83=8C=E6=99=AF/=E8=BE=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 因为percentW/H是旧尺寸与新尺寸之间的比例,所以实现组件选择宽度和高度中较小的缩放比例的规则,需要使用Math.max --- .../java/com/fr/design/designer/creator/XWAbsoluteLayout.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java index 72bb2cb032..c6d0067c3a 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -204,7 +204,8 @@ public class XWAbsoluteLayout extends XLayoutContainer { for (int index = 0, n = this.getComponentCount(); index < n; index++) { XCreator creator = (XCreator) this.getComponent(index); if (creator.toData().isAspectRatioLocked()) { - double percent = Math.min(percentW, percentH); + // 因为percentW/H是旧尺寸与新尺寸之间的比例,所以实现组件选择宽度和高度中较小的缩放比例的规则,需要使用Math.max + double percent = Math.max(percentW, percentH); percentW = percentH = percent; } BoundsWidget wgt = (BoundsWidget) layout.getBoundsWidget(creator.toData());