From 8194145fde9f4ce218d328cc2ac91d55f110eb3d Mon Sep 17 00:00:00 2001 From: hades Date: Sat, 7 May 2022 16:35:34 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-70446=20svg=E7=BB=98=E5=88=B6=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=E6=8A=97=E9=94=AF=E9=BD=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/alphafine/question/QuestionPane.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionPane.java index e0d528894..0d0d9ab63 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionPane.java @@ -9,7 +9,6 @@ import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; -import java.awt.RenderingHints; import javax.swing.JPanel; /** @@ -25,11 +24,6 @@ public class QuestionPane extends JPanel { private static final Image QUESTION_BACKGROUND_IMAGE = SVGLoader.load("/com/fr/design/mainframe/alphafine/images/groupbackgroud.svg"); - private static final int WIDTH = 40; - - private static final int HEIGHT = 40; - - public QuestionPane() { this.setBackground(new Color(0, 0, 0, 0)); } @@ -38,22 +32,20 @@ public class QuestionPane extends JPanel { protected void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2 = (Graphics2D) g; - g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); SvgPaintUtils.beforePaint(g2); // 宽高保持 int width = SystemScaleUtils.isJreHiDPIEnabled() ? (int) (getWidth() * SVGLoader.SYSTEM_SCALE) : getWidth(); int height = SystemScaleUtils.isJreHiDPIEnabled() ? (int) (getHeight() * SVGLoader.SYSTEM_SCALE) : getHeight(); if (AlphaFineUtil.unread()) { - g2.drawImage(NEW_MESSAGE_IMAGE, 0, 0, width, height, this); + g2.drawImage(NEW_MESSAGE_IMAGE, 0, 0, this); } else { - g2.drawImage(QUESTION_BACKGROUND_IMAGE, 0, 0, width, height, this); + g2.drawImage(QUESTION_BACKGROUND_IMAGE, 0, 0, this); } int imageWidth = QUESTION_IMAGE.getWidth(this); int imageHeight = QUESTION_IMAGE.getHeight(this); - g2.drawImage(QUESTION_IMAGE, (width - imageWidth) / 2, (height - imageHeight) / 2, imageWidth, imageHeight,this); + g2.drawImage(QUESTION_IMAGE, (width - imageWidth) / 2 - 2, (height - imageHeight) / 2 - 2,this); SvgPaintUtils.afterPaint(g2); }