Browse Source

REPORT-62433 11.0设计器-单元格样式-有部分样式显示的字体内容不全

【问题原因】
补充下绘制时的反锯齿

【改动思路】
同上
feature/x
Starryi 3 years ago
parent
commit
f7fcf6110c
  1. 7
      designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java

7
designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java

@ -12,6 +12,7 @@ import java.awt.Composite;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
/**
@ -44,10 +45,14 @@ public class CellStylePreviewPane extends JPanel {
public void paint(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
g.clearRect(0, 0, getWidth(), getHeight());
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
paintTransparentBackground(g2d, style);
paintCellStyle(g2d, style);
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
}
private void paintTransparentBackground(Graphics2D g2d, Style style) {

Loading…
Cancel
Save