Class HiDPIUtils
java.lang.Object
org.pushingpixels.radiance.common.internal.contrib.flatlaf.HiDPIUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static double
normalize
(double value) static void
paintAtScale1x
(Graphics2D g, int x, int y, int width, int height, RadianceCommonCortex.PainterScale1X painterScale1X) Paint at system scale factor 1x to avoid rounding issues at 125%, 150% and 175% scaling.static void
paintAtScale1x
(Graphics2D g, JComponent c, RadianceCommonCortex.PainterScale1X painterScale1X) private static Rectangle2D.Double
scale
(double scaleX, double scaleY, AffineTransform t, int x, int y, int width, int height) Scales a rectangle in the same way as the JRE does in sun.java2d.pipe.PixelToParallelogramConverter.fillRectangle(), which is used by Graphics.fillRect().
-
Constructor Details
-
HiDPIUtils
public HiDPIUtils()
-
-
Method Details
-
paintAtScale1x
public static void paintAtScale1x(Graphics2D g, JComponent c, RadianceCommonCortex.PainterScale1X painterScale1X) -
paintAtScale1x
public static void paintAtScale1x(Graphics2D g, int x, int y, int width, int height, RadianceCommonCortex.PainterScale1X painterScale1X) Paint at system scale factor 1x to avoid rounding issues at 125%, 150% and 175% scaling.Scales the given Graphics2D down to 100% and invokes the given painter passing scaled x, y, width and height.
Uses the same scaling calculation as the JRE uses.
-
scale
private static Rectangle2D.Double scale(double scaleX, double scaleY, AffineTransform t, int x, int y, int width, int height) Scales a rectangle in the same way as the JRE does in sun.java2d.pipe.PixelToParallelogramConverter.fillRectangle(), which is used by Graphics.fillRect(). -
normalize
private static double normalize(double value)
-