From ba3da486cbdc3578c2e22233569c1e814302593c Mon Sep 17 00:00:00 2001 From: pengda Date: Mon, 17 Aug 2020 14:03:05 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-37473=20=E5=A4=9A=E5=B1=82=E5=B5=8C?= =?UTF-8?q?=E5=A5=97=E7=9A=84tab=E6=A8=A1=E6=9D=BF=EF=BC=8C=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E8=BF=9B=E8=A1=8C=E5=A2=9E=E5=8A=A0=E5=88=A0=E9=99=A4?= =?UTF-8?q?tab=EF=BC=8C=E6=97=A0=E6=B3=95=E7=82=B9=E5=87=BB=E5=88=A0?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../creator/cardlayout/XCardSwitchButton.java | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java index f0e23b977f..97ab022291 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java @@ -258,10 +258,24 @@ public class XCardSwitchButton extends XButton { int ey = e.getY(); //获取tab布局的位置,鼠标相对于tab按钮的位置 - XLayoutContainer mainLayout = cardLayout.getBackupParent(); + Container mainLayout = cardLayout.getBackupParent(); Point point = mainLayout.getLocation(); - double mainX = point.getX(); - double mainY = point.getY(); + int y = 0; + int x = 0; + //遍历一下,不然是相对位置,嵌套后位置不对 + while (mainLayout.getParent() != null){ + if(mainLayout instanceof XWCardLayout){ + y += mainLayout.getY(); + } + + mainLayout = mainLayout.getParent(); + + if(mainLayout instanceof XWCardMainBorderLayout){ + x += mainLayout.getX(); + } + } + double mainX = point.getX() + x; + double mainY = point.getY() + y; // 参数界面对坐标的影响 JForm jform = (JForm) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); From c5a6e714482f2a395c891d542bf0aeddad6b77db Mon Sep 17 00:00:00 2001 From: pengda Date: Mon, 17 Aug 2020 15:06:21 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-37473=20=E5=A4=9A=E5=B1=82=E5=B5=8C?= =?UTF-8?q?=E5=A5=97=E7=9A=84tab=E6=A8=A1=E6=9D=BF=EF=BC=8C=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E8=BF=9B=E8=A1=8C=E5=A2=9E=E5=8A=A0=E5=88=A0=E9=99=A4?= =?UTF-8?q?tab=EF=BC=8C=E6=97=A0=E6=B3=95=E7=82=B9=E5=87=BB=E5=88=A0?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/designer/creator/cardlayout/XCardSwitchButton.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java index 97ab022291..335c05b97a 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java @@ -272,6 +272,7 @@ public class XCardSwitchButton extends XButton { if(mainLayout instanceof XWCardMainBorderLayout){ x += mainLayout.getX(); + y += mainLayout.getY(); } } double mainX = point.getX() + x;