From e1bd950705c905c419cb9d6223ff4ee9e9527ee9 Mon Sep 17 00:00:00 2001 From: Starryi Date: Fri, 10 Sep 2021 18:19:54 +0800 Subject: [PATCH] =?UTF-8?q?CHART-20568=20[=E4=BA=A7=E5=93=81=E9=AA=8C?= =?UTF-8?q?=E6=94=B6]=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=9B=BE=E8=A1=A8=E7=BB=84=E4=BB=B6=E9=AC=BC?= =?UTF-8?q?=E7=95=9C=20&=20CHART-20627=20=E5=9B=BE=E8=A1=A8=E5=9D=97?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=EF=BC=8C=E9=BC=A0=E6=A0=87=E5=8F=8C=E5=87=BB?= =?UTF-8?q?=EF=BC=8C=E4=BC=9A=E5=87=BA=E7=8E=B0=E5=9B=BE=E5=BD=A2=E9=87=8D?= =?UTF-8?q?=E5=BD=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 EditingMouseListener#startEditing会将图表的 ChartComponent放入FormDesigner, 作为编辑中的 ChartComponent来显示, 同时这里又在下层绘制了一遍 ChartComponent,导致图表进入编辑状态,会出现两个重 叠的ChartComponent。 考虑到编辑中,FormDesigner中的ChartComponent位于 上层,下层的ChartComponent实际上没什么用,所以可以 不用绘制下层的ChartComponent 【改动思路】 同上 --- .../com/fr/design/designer/creator/XChartEditor.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 ad328b85e7..eeb74155a3 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 @@ -232,7 +232,14 @@ public class XChartEditor extends XBorderStyleWidgetCreator { Dimension size = getSize(); PaddingMargin margin = toData().getMargin(); - designerEditor.paintEditor(g, size, margin); + if (!isEditing) { + // CHART-20568 & CHART-20627 + // EditingMouseListener#startEditing会将图表的ChartComponent放入FormDesigner, 作为编辑中的ChartComponent来显示, + // 同时这里又在下层绘制了一遍ChartComponent,导致图表进入编辑状态,会出现两个重叠的ChartComponent。 + // 考虑到编辑中,FormDesigner中的ChartComponent位于上层,下层的ChartComponent实际上没什么用,所以可以不用绘制 + // 下层的ChartComponent + designerEditor.paintEditor(g, size, margin); + } if (coverPanel != null) { int horizonMargin = margin != null ? margin.getLeft() + margin.getRight() : 0;