diff --git a/core/src/processing/opengl/PSurfaceJOGL.java b/core/src/processing/opengl/PSurfaceJOGL.java index 62dfa379c..af4dbc2fe 100644 --- a/core/src/processing/opengl/PSurfaceJOGL.java +++ b/core/src/processing/opengl/PSurfaceJOGL.java @@ -779,15 +779,19 @@ public class PSurfaceJOGL implements PSurface { } if (PApplet.platform == PConstants.MACOSX) { - // Even if the graphics are retina, the user might have moved the window - // into a non-retina monitor, so we need to check - window.getCurrentSurfaceScale(currentPixelScale); - return currentPixelScale[0]; + return getCurrentPixelScale(); } return 2; } + private float getCurrentPixelScale() { + // Even if the graphics are retina, the user might have moved the window + // into a non-retina monitor, so we need to check + window.getCurrentSurfaceScale(currentPixelScale); + return currentPixelScale[0]; + } + public Component getComponent() { return canvas; @@ -890,7 +894,8 @@ public class PSurfaceJOGL implements PSurface { public void reshape(GLAutoDrawable drawable, int x, int y, int w, int h) { pgl.resetFBOLayer(); pgl.getGL(drawable); - float scale = getPixelScale(); + float scale = PApplet.platform == PConstants.MACOSX ? + getCurrentPixelScale() : getPixelScale(); setSize((int) (w / scale), (int) (h / scale)); } }