From 38e99d5984396fbc3fef1b17447d9b5f14e01756 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Fri, 10 Feb 2017 16:30:02 -0500 Subject: [PATCH] rename retina prop based on actual use --- app/src/processing/app/ui/Toolkit.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/src/processing/app/ui/Toolkit.java b/app/src/processing/app/ui/Toolkit.java index 137b94eca..31370b3d1 100644 --- a/app/src/processing/app/ui/Toolkit.java +++ b/app/src/processing/app/ui/Toolkit.java @@ -735,6 +735,10 @@ public class Toolkit { // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + /** + * Create an Image to be used as an offscreen drawing context, + * automatically doubling the size if running on a retina display. + */ static public Image offscreenGraphics(Component comp, int width, int height) { int m = Toolkit.isRetina() ? 2 : 1; //return comp.createImage(m * dpi(width), m * dpi(height)); @@ -855,7 +859,9 @@ public class Toolkit { // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - static Boolean highResProp; + // Changed to retinaProp instead of highResProp because only Mac + // "retina" displays use this mechanism for high-resolution scaling. + static Boolean retinaProp; static public boolean highResImages() { @@ -864,10 +870,10 @@ public class Toolkit { static public boolean isRetina() { - if (highResProp == null) { - highResProp = checkRetina(); + if (retinaProp == null) { + retinaProp = checkRetina(); } - return highResProp; + return retinaProp; }