Skip to content
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

When a Shape (Line, Path, etc) changes size, the layout size does not change, so the Shape gets clipped #17942

Open
spadapet opened this issue Oct 10, 2023 · 4 comments
Assignees
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

Comments

@spadapet
Copy link
Contributor

Description

Shapes do not update their layout size when their Data changes. For example, changing Path.Data, Line.Y2, or Polyline.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:

image

Click the button to add 50 to the line height:

image

The line extends past the green border and gets clipped. If you resize the window, then layout updates:

image

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

@spadapet spadapet added t/bug Something isn't working area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing labels Oct 10, 2023
@jsuarezruiz jsuarezruiz added the area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label Oct 11, 2023
@XamlTest
Copy link
Collaborator

Verified this on Visual Studio Enterprise 17.8.0 Preview 3.0(8.0.0-rc.2.9373). Repro on Windows 11, Android 13.0-API33 and iOS 16.4 with below Project:
ShapeResize.zip

@XamlTest XamlTest added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Oct 16, 2023
@jsuarezruiz jsuarezruiz added this to the Backlog milestone Nov 3, 2023
@ghost
Copy link

ghost commented Nov 3, 2023

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

@jsuarezruiz jsuarezruiz self-assigned this Nov 3, 2023
@jsuarezruiz
Copy link
Contributor

The issue will be fixed by https://github.com/dotnet/maui/tree/fix-17942

@softlion
Copy link
Contributor

softlion commented May 13, 2024

The issue will be fixed by https://github.com/dotnet/maui/tree/fix-17942

That issue also occurs on iOS and Android sporadically with the PathGeometry shape and the Line shape.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

5 participants