From 5479bfbe43ffcf9f84a11f8302562ff9305a4e0f Mon Sep 17 00:00:00 2001 From: Starryi Date: Wed, 28 Jul 2021 17:40:15 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-56010=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=E4=B8=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=20=E6=A0=87=E9=A2=98=EF=BC=8C=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E8=BE=B9=E6=A1=86=E5=90=8E=E8=AE=BE=E8=AE=A1=E6=9C=9F=E5=86=85?= =?UTF-8?q?=E8=BE=B9=E6=A1=86=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 1. 在无标题情况下,XWTitleLayout和普通的XBorderStyleWidgetCreator一样,通过 initBorderAndBackgroundStyle区初始化背景和边框,即使它自身没有样式模型,从而获得 一个默认的灰色边框(图表块和报表块的一般组件需要默认灰色边框), 遮住了图表块和报表块的边框 2. 在有标题情况下,此时XWTitleLayout从BodyCreator处,获取了需要绘制的边框,但如果之后切换 为无标题,再更新边框样式,则新边框对象会设置到BodyCreator上,而旧边框对象因为没有被清除,所以 会继续保留在XWTitleLayout上,然后覆盖了新的边框 3. 背景也有一样的效果 【改动思路】 1. XWTitleLayout重新实现initBorderAndBackgroundStyle方法 2. 若无标题,则将XWTitleLayout的边框/背景等重制为空 【review建议】 --- .../design/designer/creator/XBorderStyleWidgetCreator.java | 4 ++++ .../java/com/fr/design/designer/creator/XWTitleLayout.java | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XBorderStyleWidgetCreator.java b/designer-form/src/main/java/com/fr/design/designer/creator/XBorderStyleWidgetCreator.java index d17351f587..485c73b164 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XBorderStyleWidgetCreator.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XBorderStyleWidgetCreator.java @@ -210,6 +210,10 @@ public class XBorderStyleWidgetCreator extends XWidgetCreator{ reshuffleBorderPaintingEffectIfTitleExists(titleParent, titleCreator, bodyXCreator); reshuffleBackgroundPaintingEffectIfTitleExists(titleParent, titleCreator, bodyXCreator); + } else { + titleParent.setBorder(null); + titleParent.setBorderImage4Painting(null, 0.0); + titleParent.setBackground4Painting(null, 0.0); } } } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java index c04c93a380..71129bed46 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java @@ -62,6 +62,13 @@ public class XWTitleLayout extends DedicateLayoutContainer { this.bodyBackgroundOpacity4Painting = opacity; } + @Override + protected void initBorderAndBackgroundStyle() { + setBorder(null); + setBorderImage4Painting(null, 0.0); + setBackground4Painting(null, 0.0); + } + @Override protected void initXCreatorProperties() { super.initXCreatorProperties();