mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
disabled perspective correction for lines in P2D and handling loadPixels() call outside beginDraw/endDraw
This commit is contained in:
@@ -28,6 +28,7 @@ public class PGraphics2D extends PGraphicsOpenGL {
|
||||
public PGraphics2D() {
|
||||
super();
|
||||
hints[ENABLE_ACCURATE_2D] = true;
|
||||
hints[ENABLE_PERSPECTIVE_CORRECTED_LINES] = false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user