Is there a similar function to pushMatrix() and popMatrix() but instead for transforms its for functions like stroke() and strokeWeight()?

pushMatrix() and popMatrix() are super useful when I want to not destroy the current coordinate system and basically switch reference frame but in that reference frame, I might want to apply settings that only apply to that specific reference frame.

Is there any way I can “keep” my drawing settings like stroke(),strokeWeight() and noFill() so I don’t have to keep track of every function, method or line of code where this might be changed?

Thanks! <3

1 Like

yes, it is very much with the same thinking like you ask,
it might be a little bit misplaced at the
https://processing.org/reference/
page, pls. see:
https://processing.org/reference/pushStyle_.html

https://processing.org/reference/popStyle_.html

3 Likes

Thank you very much!