From 0f0731d1e2b966ff292644c845dcd99e27198a4d Mon Sep 17 00:00:00 2001 From: Jakub Valtar Date: Sat, 15 Apr 2017 19:14:09 +0200 Subject: [PATCH] pixelDensity (OpenGL): tidy up some some variables --- core/src/processing/opengl/PSurfaceJOGL.java | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/core/src/processing/opengl/PSurfaceJOGL.java b/core/src/processing/opengl/PSurfaceJOGL.java index 44319cefc..bcec8d551 100644 --- a/core/src/processing/opengl/PSurfaceJOGL.java +++ b/core/src/processing/opengl/PSurfaceJOGL.java @@ -94,8 +94,6 @@ public class PSurfaceJOGL implements PSurface { protected PApplet sketch; protected PGraphics graphics; - protected int sketchX; - protected int sketchY; protected int sketchWidth0; protected int sketchHeight0; protected int sketchWidth; @@ -269,8 +267,8 @@ public class PSurfaceJOGL implements PSurface { boolean spanDisplays = sketch.sketchDisplay() == PConstants.SPAN; screenRect = spanDisplays ? - new Rectangle(0, 0, screen.getWidth(), screen.getHeight()) : - new Rectangle(0, 0, + new Rectangle(screen.getX(), screen.getY(), screen.getWidth(), screen.getHeight()) : + new Rectangle((int) displayRect.getX(), (int) displayRect.getY(), (int) displayRect.getWidth(), (int) displayRect.getHeight()); @@ -341,8 +339,6 @@ public class PSurfaceJOGL implements PSurface { window.setSize(sketchWidth * windowScaleFactor, sketchHeight * windowScaleFactor); window.setResizable(false); setSize(sketchWidth, sketchHeight); - sketchX = (int) displayRect.getX(); - sketchY = (int) displayRect.getY(); if (fullScreen) { PApplet.hideMenuBar(); if (spanDisplays) { @@ -671,10 +667,8 @@ public class PSurfaceJOGL implements PSurface { } else { // just center on screen // Can't use frame.setLocationRelativeTo(null) because it sends the // frame to the main display, which undermines the --display setting. - int sketchX = (int) displayRect.getX(); - int sketchY = (int) displayRect.getY(); - window.setTopLevelPosition(sketchX + screenRect.x + (screenRect.width - sketchWidth) / 2, - sketchY + screenRect.y + (screenRect.height - sketchHeight) / 2); + window.setTopLevelPosition(screenRect.x + (screenRect.width - sketchWidth) / 2, + screenRect.y + (screenRect.height - sketchHeight) / 2); } Point frameLoc = new Point(x, y);