From e67f0d653deb7161b25ab417692785af68b1c97f Mon Sep 17 00:00:00 2001 From: codeanticode Date: Wed, 5 Sep 2012 22:41:26 +0000 Subject: [PATCH] doesn't apply perspective correction when the projection matrix is orthographic, fixes issue 1207. --- android/core/src/processing/opengl/PGraphicsOpenGL.java | 6 ++++-- core/src/processing/opengl/PGraphicsOpenGL.java | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/android/core/src/processing/opengl/PGraphicsOpenGL.java b/android/core/src/processing/opengl/PGraphicsOpenGL.java index b036fb4d0..55b722bd4 100644 --- a/android/core/src/processing/opengl/PGraphicsOpenGL.java +++ b/android/core/src/processing/opengl/PGraphicsOpenGL.java @@ -7067,7 +7067,8 @@ public class PGraphicsOpenGL extends PGraphics { float h = pgCurrent.viewport[3]; setUniformValue(viewportLoc, x, y, w, h); - if (pgCurrent.getHint(ENABLE_STROKE_PERSPECTIVE)) { + if (pgCurrent.getHint(ENABLE_STROKE_PERSPECTIVE) && + !pgCurrent.usingOrthoProjection) { setUniformValue(perspectiveLoc, 1); } else { setUniformValue(perspectiveLoc, 0); @@ -7188,7 +7189,8 @@ public class PGraphicsOpenGL extends PGraphics { float h = pgCurrent.viewport[3]; setUniformValue(viewportLoc, x, y, w, h); - if (pgCurrent.getHint(ENABLE_STROKE_PERSPECTIVE)) { + if (pgCurrent.getHint(ENABLE_STROKE_PERSPECTIVE) && + !pgCurrent.usingOrthoProjection) { setUniformValue(perspectiveLoc, 1); } else { setUniformValue(perspectiveLoc, 0); diff --git a/core/src/processing/opengl/PGraphicsOpenGL.java b/core/src/processing/opengl/PGraphicsOpenGL.java index b036fb4d0..55b722bd4 100644 --- a/core/src/processing/opengl/PGraphicsOpenGL.java +++ b/core/src/processing/opengl/PGraphicsOpenGL.java @@ -7067,7 +7067,8 @@ public class PGraphicsOpenGL extends PGraphics { float h = pgCurrent.viewport[3]; setUniformValue(viewportLoc, x, y, w, h); - if (pgCurrent.getHint(ENABLE_STROKE_PERSPECTIVE)) { + if (pgCurrent.getHint(ENABLE_STROKE_PERSPECTIVE) && + !pgCurrent.usingOrthoProjection) { setUniformValue(perspectiveLoc, 1); } else { setUniformValue(perspectiveLoc, 0); @@ -7188,7 +7189,8 @@ public class PGraphicsOpenGL extends PGraphics { float h = pgCurrent.viewport[3]; setUniformValue(viewportLoc, x, y, w, h); - if (pgCurrent.getHint(ENABLE_STROKE_PERSPECTIVE)) { + if (pgCurrent.getHint(ENABLE_STROKE_PERSPECTIVE) && + !pgCurrent.usingOrthoProjection) { setUniformValue(perspectiveLoc, 1); } else { setUniformValue(perspectiveLoc, 0);