KEMBAR78
Avoid unnecessary final measure call on Auto/Auto cell by hartez · Pull Request #6637 · dotnet/maui · GitHub
Skip to content

Conversation

@hartez
Copy link
Contributor

@hartez hartez commented Apr 28, 2022

Description of Change

Proposing this as an alternative to #6542. This version doesn't require special-casing the button image and invalidating the parent.

The Button Image behavior described in #5601 only happens if the layout is a Grid and the Button is in a cell with Auto/Auto for the sizing. This is happening because the Button is receiving unneeded extra measurement calls at the specific default size determined for the Auto/Auto cell before the actual image has been loaded, and the internal bookkeeping for the MAUIButton doesn't think it needs to invalidate its layout once the image is loaded.

This change eliminates the extra measure call in that situation (and, as a bonus, skips that duplicate measure call in general).

Issues Fixed

Fixes #5601

@Eilon Eilon added the area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label Apr 28, 2022
@mattleibow mattleibow added this to the 6.0.300-rc.3 milestone Apr 29, 2022
@rmarinho rmarinho merged commit ced48a0 into main Apr 29, 2022
@rmarinho rmarinho deleted the fix-5601-2 branch April 29, 2022 08:59
@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2023
@samhouts samhouts added the fixed-in-6.0.300-rc.3 Look for this fix in 6.0.300-rc.3! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter fixed-in-6.0.300-rc.3 Look for this fix in 6.0.300-rc.3!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Button with image sized incorrectly on Windows

5 participants