diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java index 2fdec31e1f..a462a8aed6 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java @@ -265,11 +265,13 @@ public class WidgetBoundPane extends BasicPane { @Override public void stateChanged(ChangeEvent e) { if (isLockEnabled() && isLocked()) { - setLocked(false); - aspectRatioBackup = -1; - } else if (aspectRatioBackup > 0) { - double value = mHeightSpinner.getValue() * aspectRatioBackup; - mWidthSpinner.setValue(Math.round(value), false); + if (mHeightSpinner.getValue() == 0) { + setLocked(false); + aspectRatioBackup = -1; + }else if (aspectRatioBackup > 0) { + double value = mHeightSpinner.getValue() * aspectRatioBackup; + mWidthSpinner.setValue(Math.round(value), false); + } } } });