diff --git a/java/libraries/opengl/src/processing/opengl/PGraphics2D.java b/java/libraries/opengl/src/processing/opengl/PGraphics2D.java index 586a376a6..5e5aeb394 100644 --- a/java/libraries/opengl/src/processing/opengl/PGraphics2D.java +++ b/java/libraries/opengl/src/processing/opengl/PGraphics2D.java @@ -28,6 +28,7 @@ public class PGraphics2D extends PGraphicsOpenGL { public PGraphics2D() { super(); hints[ENABLE_ACCURATE_2D] = true; + hints[ENABLE_PERSPECTIVE_CORRECTED_LINES] = false; } } \ No newline at end of file diff --git a/java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java b/java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java index 5e4f6a05a..2a19e061f 100644 --- a/java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java +++ b/java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java @@ -4674,6 +4674,12 @@ public class PGraphicsOpenGL extends PGraphics { // Initializes the pixels array, copying the current contents of the // color buffer into it. public void loadPixels() { + boolean needEndDraw = false; + if (!drawing) { + beginDraw(); + needEndDraw = true; + } + if (!setgetPixels) { // Draws any remaining geometry in case the user is still not // setting/getting new pixels. @@ -4690,6 +4696,10 @@ public class PGraphicsOpenGL extends PGraphics { pixelsToTexture(); } } + + if (needEndDraw) { + endDraw(); + } }