Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FX: Prevent matrix stack overflow #4799

Merged
merged 1 commit into from
Jan 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions core/src/processing/javafx/PGraphicsFX2D.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public class PGraphicsFX2D extends PGraphics {
Path2D workPath = new Path2D();
Path2D auxPath = new Path2D();
boolean openContour;
boolean adjustedForThinLines;
/// break the shape at the next vertex (next vertex() call is a moveto())
boolean breakShape;

Expand Down Expand Up @@ -214,7 +215,7 @@ public void beginShape(int kind) {
flushPixels();

if (drawingThinLines()) {
pushMatrix();
adjustedForThinLines = true;
translate(0.5f, 0.5f);
}
}
Expand Down Expand Up @@ -420,8 +421,9 @@ public void endShape(int mode) {
}
}
shape = 0;
if (drawingThinLines()) {
popMatrix();
if (adjustedForThinLines) {
adjustedForThinLines = false;
translate(-0.5f, -0.5f);
}
loaded = false;
}
Expand Down