From 5b524fefbd317b63c60890434898ef71d97c8e9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Thu, 19 Aug 2021 11:04:29 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-57317=20=E4=BF=AE=E6=94=B9=E9=97=B4?= =?UTF-8?q?=E8=B7=9D=E6=8F=90=E7=A4=BA=E6=96=87=E5=AD=97=E7=9A=84=E5=A4=A7?= =?UTF-8?q?=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/FormSpacingLineDrawer.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java b/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java index 9c3dbe746c..284df68e1c 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java @@ -17,9 +17,10 @@ import java.awt.geom.RoundRectangle2D; public class FormSpacingLineDrawer { private static final Color LINE_COLOR = new Color(230, 82, 81); private static final Color TEXT_COLOR = new Color(255, 255, 255); - private static final int TEXT_PADDING_HORIZONTAL = 6; - private static final int TEXT_PADDING_VERTICAL = 1; + private static final int TEXT_PADDING_HORIZONTAL = 8; + private static final int TEXT_PADDING_VERTICAL = 2; private static final int MIN_SPACING = 10; + private static final float TIP_FONT_SIZE = 10F; private FormDesigner designer; private XCreator hoverCreator = null; @@ -109,7 +110,7 @@ public class FormSpacingLineDrawer { private void drawSpacingText(Graphics g, String text, int x, int y) { Graphics2D g2d = (Graphics2D) g.create(); g2d.setColor(LINE_COLOR); - Font newFont = g2d.getFont().deriveFont(8F).deriveFont(Font.BOLD); + Font newFont = g2d.getFont().deriveFont(TIP_FONT_SIZE).deriveFont(Font.BOLD); g2d.setFont(newFont); FontMetrics metrics = g2d.getFontMetrics(); int lineHeight = metrics.getAscent(); // 这里由于都是数字,要居中必须忽略掉leading和descent的高度