From ed44b067ccaee6a7f863604d4206d08c1a306cdd Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 17 Dec 2021 13:43:43 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-62533=E3=80=90=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E5=9B=BE=E3=80=91=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E5=8F=AA=E8=AE=BE=E7=BD=AE=E4=B8=8B=E8=BE=B9?= =?UTF-8?q?=E6=A1=86=E7=BA=BF=E6=97=B6=EF=BC=8C=E5=B7=A6=E4=BE=A7=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E5=9B=BE=E4=B8=AD=E7=9C=8B=E4=B8=8D=E5=88=B0=E6=95=88?= =?UTF-8?q?=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ecpreview/cell/AbstractPreviewCell.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/cell/AbstractPreviewCell.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/cell/AbstractPreviewCell.java index a8a5f18924..4dd7d76520 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/cell/AbstractPreviewCell.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/cell/AbstractPreviewCell.java @@ -1,12 +1,15 @@ package com.fr.design.mainframe.theme.preview.ecpreview.cell; import com.fr.base.Style; +import com.fr.stable.Constants; + import javax.swing.JComponent; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; public abstract class AbstractPreviewCell extends JComponent { + private static final double BORDER_INSET = 0.5D; protected Style style = Style.DEFAULT_STYLE; private static final int NO_SCALE_RESOLUTION = 100; @@ -19,7 +22,19 @@ public abstract class AbstractPreviewCell extends JComponent { Graphics2D g2d = (Graphics2D) g; Style.paintBackground(g2d, style, getWidth(), getHeight()); paintContent(g2d, NO_SCALE_RESOLUTION); - Style.paintBorder(g2d, style, getWidth(), getHeight()); + paintBorder(g2d); + } + + private void paintBorder(Graphics2D g2d) { + double width = getWidth(); + double height = getHeight(); + if (style.getBorderLeft() == Constants.LINE_SLIM || style.getBorderRight() == Constants.LINE_SLIM) { + width -= BORDER_INSET; + } + if (style.getBorderBottom() == Constants.LINE_SLIM || style.getBorderTop() == Constants.LINE_SLIM) { + height -= BORDER_INSET; + } + Style.paintBorder(g2d, style, width, height); } protected abstract void paintContent(Graphics2D g2d, int resolution);