Browse Source

Pull request #5410: REPORT-57317 修改间距提示文字的大小

Merge in DESIGN/design from ~FANGLEI/design10.0:feature/10.0 to feature/10.0

* commit '5b524fefbd317b63c60890434898ef71d97c8e9e':
  REPORT-57317 修改间距提示文字的大小
feature/10.0
fanglei 3 years ago
parent
commit
1b0436191e
  1. 7
      designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java

7
designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java

@ -17,9 +17,10 @@ import java.awt.geom.RoundRectangle2D;
public class FormSpacingLineDrawer { public class FormSpacingLineDrawer {
private static final Color LINE_COLOR = new Color(230, 82, 81); 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 Color TEXT_COLOR = new Color(255, 255, 255);
private static final int TEXT_PADDING_HORIZONTAL = 6; private static final int TEXT_PADDING_HORIZONTAL = 8;
private static final int TEXT_PADDING_VERTICAL = 1; private static final int TEXT_PADDING_VERTICAL = 2;
private static final int MIN_SPACING = 10; private static final int MIN_SPACING = 10;
private static final float TIP_FONT_SIZE = 10F;
private FormDesigner designer; private FormDesigner designer;
private XCreator hoverCreator = null; private XCreator hoverCreator = null;
@ -109,7 +110,7 @@ public class FormSpacingLineDrawer {
private void drawSpacingText(Graphics g, String text, int x, int y) { private void drawSpacingText(Graphics g, String text, int x, int y) {
Graphics2D g2d = (Graphics2D) g.create(); Graphics2D g2d = (Graphics2D) g.create();
g2d.setColor(LINE_COLOR); 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); g2d.setFont(newFont);
FontMetrics metrics = g2d.getFontMetrics(); FontMetrics metrics = g2d.getFontMetrics();
int lineHeight = metrics.getAscent(); // 这里由于都是数字,要居中必须忽略掉leading和descent的高度 int lineHeight = metrics.getAscent(); // 这里由于都是数字,要居中必须忽略掉leading和descent的高度

Loading…
Cancel
Save