-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Windows] Correctly size the ImageButton BitmapImage #6663
Conversation
nativeImage.Width = imageSourceSize.Width; | ||
nativeImage.Height = imageSourceSize.Height; | ||
|
||
nativeImage.Width = button.Width > 0 ? platformButton.ActualWidth : imageSourceSize.Width; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If ImageButton HeightRequest and WidthRequest properties have been set we use that values on the image. Otherwise, the height and width of the original image size is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe EZ added a special value for this: Primitives.Dimension.Unset
The Width/Height properties are already massaged into either Unset or a positive value, so we should probably use that to be consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens when the the button changes size? Also, is this possible to be tested?
nativeImage.Width = imageSourceSize.Width; | ||
nativeImage.Height = imageSourceSize.Height; | ||
|
||
nativeImage.Width = button.Width > 0 ? platformButton.ActualWidth : imageSourceSize.Width; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe EZ added a special value for this: Primitives.Dimension.Unset
The Width/Height properties are already massaged into either Unset or a positive value, so we should probably use that to be consistent.
Description of Change
Correctly size the Windows ImageButton BitmapImage.
Issues Fixed
Fixes #4913