Browse Source

REPORT-34739 自适应布局下调整绝对画布块高度,绝对画布块乱跳并导致撤销功能失效

【问题原因】在调整绝对画布块的高度时,因为前面对绝对画布块的backupBounds做了处理,忽略了参数面板块高度带来的偏移量,所以会导致其乱跳并且撤销出错
【改动方案】在com.fr.design.designer.beans.adapters.layout.FRFitLayoutAdapter.fix(com.fr.design.designer.creator.XCreator)方法中加个判断,如果是绝对画布块,就将漏算的偏移量加上
bugfix/10.0
Yvan 4 years ago
parent
commit
91bf901837
  1. 15
      designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java

15
designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java

@ -5,6 +5,7 @@ package com.fr.design.designer.beans.adapters.layout;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.GroupModel; import com.fr.design.beans.GroupModel;
import com.fr.design.designer.TargetComponent;
import com.fr.design.designer.beans.ConstraintsGroupModel; import com.fr.design.designer.beans.ConstraintsGroupModel;
import com.fr.design.designer.beans.HoverPainter; import com.fr.design.designer.beans.HoverPainter;
import com.fr.design.designer.beans.painters.FRFitLayoutPainter; import com.fr.design.designer.beans.painters.FRFitLayoutPainter;
@ -19,7 +20,14 @@ import com.fr.design.designer.creator.cardlayout.XWCardTitleLayout;
import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; import com.fr.design.designer.creator.cardlayout.XWTabFitLayout;
import com.fr.design.designer.properties.FRFitLayoutConstraints; import com.fr.design.designer.properties.FRFitLayoutConstraints;
import com.fr.design.designer.properties.FRFitLayoutPropertiesGroupModel; import com.fr.design.designer.properties.FRFitLayoutPropertiesGroupModel;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.fun.FormWidgetOptionProvider; import com.fr.design.fun.FormWidgetOptionProvider;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.JForm;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.ComponentUtils;
import com.fr.form.ui.LayoutBorderStyle; import com.fr.form.ui.LayoutBorderStyle;
import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WAbsoluteLayout;
@ -342,7 +350,12 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
//拖拽组件原大小、位置 //拖拽组件原大小、位置
Rectangle backupBound = creator.getBackupBound(); Rectangle backupBound = creator.getBackupBound();
backupBound.x -= container.getX(); backupBound.x -= container.getX();
backupBound.y -= container.getY(); // REPORT-34739 对绝对画布块的backupBound.y的调整还需要考虑一下参数面板块的高度造成的偏移
int paraHeight = 0;
if (creator instanceof XWAbsoluteLayout) {
paraHeight = WidgetPropertyPane.getInstance().getEditingFormDesigner().getParaHeight();
}
backupBound.y -= (container.getY() - paraHeight);
//当前拖拽组件的位置 //当前拖拽组件的位置
int x = creator.getX(); int x = creator.getX();
int y = creator.getY(); int y = creator.getY();

Loading…
Cancel
Save