From eebc59f53fc1d8565d9ba11b567e68217320f377 Mon Sep 17 00:00:00 2001 From: Starryi Date: Thu, 15 Jul 2021 17:32:34 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-55214=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-=E7=BB=84=E4=BB=B6=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E7=8A=B6=E6=80=81=EF=BC=8C=E8=93=9D=E8=89=B2=E5=AE=9E=E7=BA=BF?= =?UTF-8?q?=E8=BE=B9=E6=A1=86=E6=84=9F=E8=A7=89=E4=B8=8D=E5=A4=AA=E6=98=8E?= =?UTF-8?q?=E6=98=BE=EF=BC=8C=E5=92=8C=E4=BA=A4=E4=BA=92=E5=9B=BE=E9=A2=84?= =?UTF-8?q?=E6=9C=9F=E6=95=88=E6=9E=9C=E4=B8=8D=E5=A4=AA=E4=B8=80=E6=A0=B7?= =?UTF-8?q?=EF=BC=9B=E9=98=B4=E5=BD=B1=E6=95=88=E6=9E=9C=E7=9C=8B=E8=B5=B7?= =?UTF-8?q?=E6=9D=A5=E6=AD=A3=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 编辑时的内边框之前在XChartEditor的paintForeground里绘制,会被圆角效果裁剪 【改动思路】 编辑时的内边框放在paintBorder(Graphics g, Rectangle bounds)中绘制,该方法由 FormDesigner调用,不受组件内部影响 --- .../main/java/com/fr/design/designer/creator/XChartEditor.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java b/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java index 531a94ec6e..8633c0bd51 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java @@ -146,6 +146,9 @@ public class XChartEditor extends XBorderStyleWidgetCreator { if (isEditing) { g.setColor(OUTER_BORDER_COLOR); GraphHelper.draw(g, new Rectangle(bounds.x - BORDER_WIDTH, bounds.y - BORDER_WIDTH, bounds.width + BORDER_WIDTH + 1, bounds.height + BORDER_WIDTH + 1), Constants.LINE_LARGE); + + g.setColor(INNER_BORDER_COLOR); + GraphHelper.draw(g, new Rectangle(bounds.x, bounds.y, bounds.width, bounds.height), Constants.LINE_MEDIUM); } else if (!isHovering) { super.paintBorder(g, bounds); } From 3108b10c7bae76cec12a7d8122760d958ec26b8a Mon Sep 17 00:00:00 2001 From: Starryi Date: Thu, 15 Jul 2021 17:37:37 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-55149=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=9B=BE=E8=A1=A8=E5=9D=97=E6=B2=A1?= =?UTF-8?q?=E7=9C=8B=E5=88=B0=E5=86=85=E8=BE=B9=E8=B7=9D=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 设置内边距后,图表块进入编辑状态,图表编辑控件的尺寸正常,但是显示位置不对,没有留出 顶部和左侧内边距的空间 【改动思路】 需要在图表编辑器布局后,按照内边距重新调整下位置 --- .../design/designer/beans/events/DesignerEditor.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/events/DesignerEditor.java b/designer-form/src/main/java/com/fr/design/designer/beans/events/DesignerEditor.java index a1c9f1ff9f..f53f66d313 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/events/DesignerEditor.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/events/DesignerEditor.java @@ -86,9 +86,15 @@ public class DesignerEditor implements PropertyChangeListe int horizonMargin = marginLeft + marginRight; int verticalMargin = marginTop + marginBottom; - comp.setSize(new Dimension(size.width - 2 - horizonMargin, size.height - 2 - verticalMargin)); + int x = 1 + marginLeft; + int y = 1 + marginTop; + int width = size.width - 2 - horizonMargin; + int height = size.height - 2 - verticalMargin; + + comp.setSize(new Dimension(width, height)); LayoutUtils.layoutContainer(comp); - Graphics clipg = g.create(1 + marginLeft, 1 + marginTop, size.width, size.height); + comp.setBounds(comp.getX() + x, comp.getY() + y, width, height); + Graphics clipg = g.create(x, y, width, height); this.comp.paint(clipg); } }