From 9de0d420d48693aefd9822fb9ef01345413f7b2e Mon Sep 17 00:00:00 2001 From: hades Date: Sun, 25 Jul 2021 13:20:04 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-55753=20=E3=80=90=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E8=83=8C=E6=99=AF=E5=88=86=E7=A6=BB=E3=80=91=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=A4=8D=E7=94=A8-=E5=B7=A5=E5=85=B7=E6=A0=8F=E7=9A=84?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=BD=8D=E7=BD=AE=E4=B8=8D=E8=B6=85=E8=BF=87?= =?UTF-8?q?=E7=BB=98=E5=88=B6=E5=8C=BA=E5=9F=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/designer/creator/XCreator.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java index dbc956c85..3b991d4a0 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java @@ -776,8 +776,13 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo if (popup == null) { popup = new SelectedPopupDialog(this, designer); } - int extraX = (int) ((bounds.x + bounds.width + SelectedPopupDialog.OFFSET_X) * designer.getScale()); - int extraY = (int) (bounds.y * designer.getScale()); + int creatorRightX = (int) ((bounds.x + bounds.width + SelectedPopupDialog.OFFSET_X) * designer.getScale()); + int creatorRightY = (int) (bounds.y * designer.getScale()); + int formDesignerWidth = designer.getWidth(); + int formDesignerHeight = designer.getHeight(); + // 不超过可绘制区域 + int extraX = Math.min(creatorRightX, formDesignerWidth); + int extraY = creatorRightY < 0 ? 0 : Math.min(creatorRightY, formDesignerHeight); // 放到事件尾部执行 SwingUtilities.invokeLater(new Runnable() { @Override