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

Avoid unnecessary final measure call on Auto/Auto cell #6637

Merged
merged 1 commit into from
Apr 29, 2022
Merged

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
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Button with image sized incorrectly on Windows
4 participants