From e457bb3337127531e3269b267caa6aaa8263341f Mon Sep 17 00:00:00 2001 From: Jakub Valtar Date: Fri, 14 Apr 2017 19:38:33 +0200 Subject: [PATCH] pixelDensity (OpenGL): fix stop button on Mac --- core/src/processing/opengl/PSurfaceJOGL.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/src/processing/opengl/PSurfaceJOGL.java b/core/src/processing/opengl/PSurfaceJOGL.java index af4dbc2fe..44319cefc 100644 --- a/core/src/processing/opengl/PSurfaceJOGL.java +++ b/core/src/processing/opengl/PSurfaceJOGL.java @@ -1046,8 +1046,7 @@ public class PSurfaceJOGL implements PSurface { int scale; if (PApplet.platform == PConstants.MACOSX) { - window.getCurrentSurfaceScale(currentPixelScale); - scale = (int) currentPixelScale[0]; + scale = (int) getCurrentPixelScale(); } else { scale = (int) getPixelScale(); } @@ -1060,7 +1059,7 @@ public class PSurfaceJOGL implements PSurface { mx -= (int)pgl.presentX; my -= (int)pgl.presentY; if (peAction == KeyEvent.RELEASE && - pgl.insideStopButton(sx, sy - screenRect.height / scale)) { + pgl.insideStopButton(sx, sy - screenRect.height / windowScaleFactor)) { sketch.exit(); } if (mx < 0 || sketchWidth < mx || my < 0 || sketchHeight < my) {