Browse Source

REPORT-53175【10.0.18】组件背景分离为标题/背景/边框

因为percentW/H是旧尺寸与新尺寸之间的比例,所以实现组件选择宽度和高度中较小的缩放比例的规则,需要使用Math.max
feature/10.0
Starryi 3 years ago
parent
commit
5d64f79279
  1. 3
      designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java

3
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());

Loading…
Cancel
Save