When a Shape (Line, Path, etc) changes size, the layout size does not change, so the Shape gets clipped #17942
Labels
area-drawing
Shapes, Borders, Shadows, Graphics, BoxView, custom drawing
area-layout
StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter
platform/android 🤖
platform/iOS 🍎
platform/macOS 🍏
macOS / Mac Catalyst
platform/windows 🪟
s/triaged
Issue has been reviewed
s/verified
Verified / Reproducible Issue ready for Engineering Triage
t/bug
Something isn't working
Milestone
Description
Shapes do not update their layout size when their Data changes. For example, changing
Path.Data
,Line.Y2
, orPolyline.StrokeThickness
will keep the old layout size, which can clip the shape.I created a branch to work on a fix for this, but it was taking long to debug and the fix seemed "scary" to me (I didn't want to break layout), but here it is:
That could be the start of a real fix, but I'm not sure about the hacks needed to force layout to compute a new Shape size.
Steps to Reproduce
Repro project: ShapeResize.sln:
Running that app shows:
Click the button to add 50 to the line height:
The line extends past the green border and gets clipped. If you resize the window, then layout updates:
Link to public reproduction project repository
https://github.com/spadapet/maui_bugs/tree/main/ShapeResize
Version with bug
8.0.0-rc.1.9171
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS, Android, Windows, macOS
Affected platform versions
net8.0-windows10.0.19041.0
Did you find any workaround?
After updating a Shape (Line, Path, etc) then it needs to be removed and re-added to the app in order to update its layout size.
That's what XAML Hot Reload currently does in order to work around this layout issue. If you have access, here's the UITools PR:
Relevant log output
No response
The text was updated successfully, but these errors were encountered: