FX: Prevent matrix stack overflow #4799

Merged
merged 1 commit into from Jan 6, 2017

Conversation

Projects
None yet
2 participants
@JakubValtar
Contributor

JakubValtar commented Dec 29, 2016

Matrix stack could overflow in a very special case when beginShape() was
called while strokeWeight=1 and then strokeWeight was changed before
endShape(). This PR makes sure matrix is popped correctly even when user
changes strokeWeight in the beginShape()/endShape() block.

Decided to bug user only when necessary and not show warining when user
changes strokeWeight in the beginShape()/endShape() block, same as in
JAVA2D. Otherwise we could add checks for all the other things which are
mentioned in the docs, but it would be hell to maintain and use.

Fixes #4206

FX: Prevent matrix stack overflow
Matrix stack could overflow in a very special case when beginShape() was
called while strokeWeight=1 and then strokeWeight was changed before
endShape(). This PR makes sure matrix is popped correctly even when user
changes strokeWeight in the beginShape()/endShape() block.

Decided to bug user only when necessary and not show warining when user
changes strokeWeight in the beginShape()/endShape() block, same as in
JAVA2D. Otherwise we could add checks for all the other things which are
mentioned in the docs, but it would be hell to maintain and use.

Fixes #4206

@benfry benfry merged commit 8e290cd into processing:master Jan 6, 2017

@JakubValtar JakubValtar deleted the JakubValtar:fix-matrix-overflow branch Jan 6, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment