From a601323b50169eac818bfcd6ce502beb1c9886ce Mon Sep 17 00:00:00 2001 From: Jakub Valtar Date: Wed, 12 Apr 2017 18:57:44 +0200 Subject: [PATCH] pixelDensity (OpenGL): fix 2x present mode on Windows --- core/src/processing/opengl/PSurfaceJOGL.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/processing/opengl/PSurfaceJOGL.java b/core/src/processing/opengl/PSurfaceJOGL.java index 381900a00..0d15936e2 100644 --- a/core/src/processing/opengl/PSurfaceJOGL.java +++ b/core/src/processing/opengl/PSurfaceJOGL.java @@ -751,8 +751,9 @@ public class PSurfaceJOGL implements PSurface { public void placePresent(int stopColor) { - pgl.initPresentMode(0.5f * (screenRect.width - sketchWidth), - 0.5f * (screenRect.height - sketchHeight), stopColor); + float scale = getPixelScale(); + pgl.initPresentMode(0.5f * (screenRect.width/scale - sketchWidth), + 0.5f * (screenRect.height/scale - sketchHeight), stopColor); window.setSize(screenRect.width, screenRect.height); PApplet.hideMenuBar(); window.setTopLevelPosition(sketchX + screenRect.x,