hades
3 years ago
6 changed files with 61 additions and 10 deletions
@ -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…
Reference in new issue