-
Notifications
You must be signed in to change notification settings - Fork 358
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
Context.Pop() does not restore to previous state #27
Comments
@fogleman Do you have any comments on the pull request for this issue? I would love to use this library for my project because the API is very well-written. This problem is coming up for me when I use the recursive Push(), DrawRectangle(), Clip(), render(), Pop() pattern for a scene graph. |
One thing to note is that the current path is not affected by Push/Pop. This behavior is borrowed from Cairo. From their docs:
I seem to have treated the clipping region the same way, but I can't remember why. I'd be okay with changing that, but I think @derekschaab 's PR breaks the behavior mentioned above. |
@dsamarin Anyway, in the meantime you can simply use |
|
When applying a clipping mask after saving the current context state, calling
context.Pop()
does not revert to the previous clipping mask. (It appears that this does not revert anything, but the effect on the mask is more obvious than other side effects.) Objects drawn after the call toPop()
are still affected by the mask.Demonstration of issue. PR on the way.
The text was updated successfully, but these errors were encountered: