PushClip interfears with previous render instructions when the UIElement is huge
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
### Description
In my control I override OnRender so that I can draw the control background but also to draw a GlyphRun for fast rendering. However I use `PushClip` (passing in a RectangleGeometry with the rect 0, 0, ActualWidth, ActualHeight) before and `Pop` after calling `DrawGlyphRun`, and I noticed that when my control is extremely big (a width or height generally around 100,000,000 pixels), the background would disappear but the text would still be drawn
### Reproduction Steps
Create a control and place it in something like a Grid. Set the control's width to maybe 500 million. Override the OnRender function, create a Rect called sizeRect with a value of `0,0,ActualWidth,ActualHeight`. Draw a rectangle or some sort of shape that spans the entire control (using that sizeRect). Then, draw something else but Push a RectangleGeometry clipping before so, then pop the clip
### Expected behavior
I'd expect the clip that was pushed to only affect any render calls AFTER the clip was pushed up until it was popped
### Actual behavior
When the control is extremely big, that clip somehow interferes with previous render instructions. The control has to be big for it to occur, in the 100s of millions of pixels wide/high
### Regression?
_No response_
### Known Workarounds
I push the clip at the start of my OnRender method, and Pop at the end. My use case lets me, but I feel like this might not work in some cases (with advanced clip usages)
### Impact
If you have a zoom mechanism implemented that auto-resizes controls based on the zoom level, you may have to create a zoom limit based on the size of all controls based on trial and error
### Configuration
- .NET Framework 4.8
- Windows 10
- x64
- Not sure
### Other information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.