From a9f27d13dee610732c1f45648d96eb30a97e1b77 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Wed, 11 Dec 2013 23:00:04 -0500 Subject: [PATCH] trying to fix regression introduced in camera setup in P2D (issue #2259) --- core/src/processing/opengl/PGraphics2D.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/core/src/processing/opengl/PGraphics2D.java b/core/src/processing/opengl/PGraphics2D.java index 2d05921a1..fbb8779e3 100644 --- a/core/src/processing/opengl/PGraphics2D.java +++ b/core/src/processing/opengl/PGraphics2D.java @@ -119,7 +119,8 @@ public class PGraphics2D extends PGraphicsOpenGL { @Override protected void defaultPerspective() { - super.ortho(width/2f, (3f/2f) * width, -height/2f, height/2f, -1, +1); +// super.ortho(width/2f, (3f/2f) * width, -height/2f, height/2f, -1, +1); + super.ortho(0, width, 0, height, -1, +1); } @@ -156,7 +157,8 @@ public class PGraphics2D extends PGraphicsOpenGL { @Override protected void defaultCamera() { - resetMatrix(); + super.camera(width/2f, height/2f); +// resetMatrix(); } @@ -180,6 +182,11 @@ public class PGraphics2D extends PGraphicsOpenGL { popProjection(); } + @Override + public void resetMatrix() { + super.resetMatrix(); + defaultCamera(); + } //////////////////////////////////////////////////////////////