Browse Source

REPORT-70446 添加工具方法

release/11.0
hades 3 years ago
parent
commit
5e3cf961e5
  1. 28
      designer-base/src/main/java/com/fr/design/utils/SvgPaintUtils.java

28
designer-base/src/main/java/com/fr/design/utils/SvgPaintUtils.java

@ -0,0 +1,28 @@
package com.fr.design.utils;
import com.fr.base.svg.SVGLoader;
import com.fr.base.svg.SystemScaleUtils;
import java.awt.Graphics2D;
/**
* 用于绘制svg图片缩放(高分屏下)
*
* @author hades
* @version 11.0
* Created by hades on 2022/5/6
*/
public class SvgPaintUtils {
public static void beforePaint(Graphics2D g2) {
if (SystemScaleUtils.isJreHiDPIEnabled()) {
g2.scale(1 / SVGLoader.SYSTEM_SCALE, 1 / SVGLoader.SYSTEM_SCALE);
}
}
public static void afterPaint(Graphics2D g2) {
if (SystemScaleUtils.isJreHiDPIEnabled()) {
g2.scale(SVGLoader.SYSTEM_SCALE, SVGLoader.SYSTEM_SCALE);
}
}
}
Loading…
Cancel
Save