From 5f0d39ecb9c8560aa879639088ba682a655c0ef6 Mon Sep 17 00:00:00 2001 From: Yvan Date: Tue, 13 Apr 2021 17:16:59 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-49686=20=E5=86=B3=E7=AD=96=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E8=87=AA=E9=80=82=E5=BA=94=E5=B8=83=E5=B1=80=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E6=97=A0=E6=B3=95=E9=80=9A=E8=BF=87=E5=8F=B3=E4=BE=A7?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=9D=A2=E6=9D=BF=E8=B0=83=E6=95=B4=E7=BB=9D?= =?UTF-8?q?=E5=AF=B9=E7=94=BB=E5=B8=83=E5=9D=97=E7=9A=84=E5=A4=A7=E5=B0=8F?= =?UTF-8?q?=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91?= =?UTF-8?q?=E8=BF=99=E9=87=8C=E7=BB=9D=E5=AF=B9=E7=94=BB=E5=B8=83=E5=9D=97?= =?UTF-8?q?=E7=9A=84=E9=AB=98=E5=BA=A6=E8=B0=83=E6=95=B4=E8=A6=81=E5=88=86?= =?UTF-8?q?=E4=B8=BA=E4=B8=A4=E7=A7=8D=E6=96=B9=E5=BC=8F=EF=BC=8C=E4=B8=80?= =?UTF-8?q?=E7=A7=8D=E6=98=AF=E6=8B=96=E6=8B=BD=E6=94=B9=E5=8F=98=EF=BC=8C?= =?UTF-8?q?=E5=8F=A6=E4=B8=80=E7=A7=8D=E6=98=AF=E5=9C=A8=E5=8F=B3=E4=BE=A7?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E4=B8=AD=E6=94=B9=E5=8F=98=E9=AB=98=E5=BA=A6?= =?UTF-8?q?=E6=95=B0=E5=80=BC=EF=BC=8C=E9=97=A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=E6=8E=A5=E8=B5=B0=E5=88=B0FRFitLayo?= =?UTF-8?q?utAdapter#fix()=E4=B8=AD=EF=BC=8C=E6=AD=A4=E6=97=B6=E6=98=AF?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=BC=8F=E7=AE=97=E5=8F=82=E6=95=B0=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E9=AB=98=E5=BA=A6=E7=9A=84=EF=BC=8C=E5=9B=A0=E6=AD=A4?= =?UTF-8?q?=E7=BB=8F=E8=BF=87=E5=A4=84=E7=90=86=E4=B9=8B=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E5=8F=8D=E8=80=8C=E7=BB=84=E4=BB=B6=E7=9A=84backupBound?= =?UTF-8?q?=E4=BC=9A=E5=A4=9A=E4=BA=86=E4=B8=AA=E5=8F=82=E6=95=B0=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E9=AB=98=E5=BA=A6=EF=BC=8C=E8=BF=99=E6=A0=B7=E4=BC=9A?= =?UTF-8?q?=E9=80=A0=E6=88=90=E6=AF=8F=E6=AC=A1=E6=94=B9=E5=8F=98=E9=83=BD?= =?UTF-8?q?=E5=8A=A0=E4=B8=8A=E8=BF=99=E4=B8=AA=E9=AB=98=E5=BA=A6=EF=BC=8C?= =?UTF-8?q?=E5=B0=B1=E5=87=BA=E7=8E=B0=E4=BA=86bug=E7=8E=B0=E8=B1=A1=20?= =?UTF-8?q?=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E6=8A=8A?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E6=BC=8F=E7=AE=97=E7=9A=84=E9=80=BB=E8=BE=91=E6=94=BE?= =?UTF-8?q?=E5=88=B0FormSelection#fixCreator()=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adapters/layout/FRFitLayoutAdapter.java | 10 +--------- .../com/fr/design/mainframe/FormSelection.java | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 10 deletions(-) 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) {