pixelDensity (OpenGL): fix 2x present mode on Windows

This commit is contained in:
Jakub Valtar
2017-04-12 18:57:44 +02:00
parent d94987cbce
commit a601323b50

View File

@@ -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,