diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/ProductNewsImagePanel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/ProductNewsImagePanel.java index dd1b3c4833..b46d094d8b 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/ProductNewsImagePanel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/ProductNewsImagePanel.java @@ -2,8 +2,10 @@ package com.fr.design.mainframe.alphafine.component; import com.fr.base.GraphHelper; import com.fr.base.svg.SVGLoader; +import com.fr.base.svg.SystemScaleUtils; import com.fr.design.DesignerEnvManager; import com.fr.design.mainframe.alphafine.model.ProductNews; +import com.fr.design.utils.SvgPaintUtils; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; @@ -56,7 +58,9 @@ public class ProductNewsImagePanel extends JPanel { } Set readSet = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().getReadSet(); if (!readSet.contains(productNews.getId())) { - g2.drawImage(NEW_TIP_IMAGE, 0, 0, (int) (NEW_TIP_IMAGE.getWidth(this) / SVGLoader.SYSTEM_SCALE), (int) (NEW_TIP_IMAGE.getHeight(this) / SVGLoader.SYSTEM_SCALE), this); + SvgPaintUtils.beforePaint(g2); + g2.drawImage(NEW_TIP_IMAGE, 0, 0, this); + SvgPaintUtils.afterPaint(g2); } g2.setColor(BACKGROUND_COLOR); 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 81617d0d8a..e0d5288947 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 @@ -1,7 +1,9 @@ package com.fr.design.mainframe.alphafine.question; import com.fr.base.svg.SVGLoader; +import com.fr.base.svg.SystemScaleUtils; import com.fr.design.mainframe.alphafine.AlphaFineUtil; +import com.fr.design.utils.SvgPaintUtils; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; @@ -23,6 +25,10 @@ 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)); @@ -34,14 +40,21 @@ public class QuestionPane extends JPanel { 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, getWidth(), getHeight(), this); + g2.drawImage(NEW_MESSAGE_IMAGE, 0, 0, width, height, this); } else { - g2.drawImage(QUESTION_BACKGROUND_IMAGE, 0, 0, getWidth(), getHeight(), this); + g2.drawImage(QUESTION_BACKGROUND_IMAGE, 0, 0, width, height, this); } - int imageWidth = (int) (QUESTION_IMAGE.getWidth(this) / SVGLoader.SYSTEM_SCALE); - int imageHeight = (int) (QUESTION_IMAGE.getHeight(this) / SVGLoader.SYSTEM_SCALE); - g2.drawImage(QUESTION_IMAGE, (getWidth() - imageWidth) / 2, (getHeight() - imageHeight) / 2, imageWidth, imageHeight, 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); + SvgPaintUtils.afterPaint(g2); } diff --git a/designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/group_new.svg b/designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/group_new.svg index af299d12bd..9b25587c48 100644 --- a/designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/group_new.svg +++ b/designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/group_new.svg @@ -1,4 +1,4 @@ - +