-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Made clear behavior in RenderTargetBitmap.CreateDrawingContext optional #12793
Made clear behavior in RenderTargetBitmap.CreateDrawingContext optional #12793
Conversation
The original behavior is still preserved so this shouldn't be a breaking change for anyone relying on the clear behavior.
@dotnet-policy-service agree |
You can test this PR using the following package version. |
…ap-createdrawingcontext
You can test this PR using the following package version. |
… editing the current image data and not clearing it.
…ingcontext' of github.com:PMahern/Avalonia into feature/optional-clear-in-rendertargetbitmap-createdrawingcontext
…ap-createdrawingcontext
You can test this PR using the following package version. |
You can test this PR using the following package version. |
…ap-createdrawingcontext
You can test this PR using the following package version. |
The original behavior is still preserved so this shouldn't be a breaking change for anyone relying on the clear behavior.
What does the pull request do?
The current behavior in RenderTargetBitmap.CreateDrawingContext clears the image every time a DrawingContext is created. This is actually a breaking change from old behavior, I may have missed it but I didn't see it documented as such anywhere. I simply added another CreateDrawingContext(bool clear) function that clears the bitmap if true is passed in and then call it from CreateDrawingContext() with true passed in.
What is the updated/expected behavior with this PR?
Create a RenderTargetBitmap bound to an Image.
Create multiple DrawingContexts via CreateDrawingContext(false) that each draw in different areas of the image.
Both drawn shapes should remain in the image.
Checklist
Fixed issues
Fixes #12792