From 68e8f848b9ae75bf8483a2b6272eeb3b63a06ef1 Mon Sep 17 00:00:00 2001 From: Jakub Valtar Date: Sat, 18 Feb 2017 20:28:06 +0100 Subject: [PATCH] pixelDensity (OpenGL): update sketch pixel size when display density changes --- core/src/processing/opengl/PGraphicsOpenGL.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/processing/opengl/PGraphicsOpenGL.java b/core/src/processing/opengl/PGraphicsOpenGL.java index 6ab34bf16..2a03b88bc 100644 --- a/core/src/processing/opengl/PGraphicsOpenGL.java +++ b/core/src/processing/opengl/PGraphicsOpenGL.java @@ -695,6 +695,10 @@ public class PGraphicsOpenGL extends PGraphics { float f = pgl.getPixelScale(); pixelWidth = (int)(width * f); pixelHeight = (int)(height * f); + if (primaryGraphics) { + parent.pixelWidth = pixelWidth; + parent.pixelHeight = pixelHeight; + } }