diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java index c0eb392979..22d74d7741 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java @@ -347,15 +347,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { //拖拽组件原大小、位置 Rectangle backupBound = creator.getBackupBound(); backupBound.x -= container.getX(); - // REPORT-34739 对绝对画布块的backupBound.y的调整还需要考虑一下参数面板块的高度造成的偏移 - int paraHeight = 0; - if (creator.acceptType(XWAbsoluteLayout.class)) { - JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - if (jTemplate instanceof JForm) { - paraHeight = ((JForm) jTemplate).getFormDesign().getParaHeight(); - } - } - backupBound.y -= (container.getY() - paraHeight); + backupBound.y -= container.getY(); //当前拖拽组件的位置 int x = creator.getX(); int y = creator.getY(); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java b/designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java index cbebbcba16..97228209a1 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java @@ -12,6 +12,7 @@ import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.cardlayout.XWCardTagLayout; import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.Widget; @@ -270,7 +271,9 @@ public class FormSelection { LayoutAdapter layoutAdapter = AdapterBus.searchLayoutAdapter(designer, creator); if (layoutAdapter != null) { if (creator.acceptType(XWAbsoluteLayout.class) && recs.size() > i) { - creator.setBackupBound(recs.get(i)); + Rectangle rectangle = recs.get(i); + check4ParaPane(rectangle); + creator.setBackupBound(rectangle); } else { creator.setBackupBound(backupBounds); } @@ -280,6 +283,19 @@ public class FormSelection { } } + /** + * 检查下有没有参数面板,如果存在,处理下参数面板造成的偏移量 + * @param rectangle + */ + private void check4ParaPane(Rectangle rectangle) { + int paraHeight = 0; + JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + if (jTemplate instanceof JForm) { + paraHeight = ((JForm) jTemplate).getFormDesign().getParaHeight(); + } + rectangle.y += paraHeight; + } + private void removeCreatorFromContainer(XCreator creator) { XLayoutContainer parent = XCreatorUtils.getParentXLayoutContainer(creator); if (parent == null) {