Skip to content

[Windows] Button font image source incorrectly sized on 8.0.10 when specifying a button HeightRequest #21202

@MitchBomcanhao

Description

@MitchBomcanhao

Description

From version 8.0.10, using a font image source on a button image source is incorrectly resizing its content when a heightrequest is set on the button, resulting in the UI having different sized elements and the font image itself looking blurry (and increasingly blurrier depending on how small you had set the size for the font image source).

[Note: version 8.0.10 is missing from the list of versions in this bug form, which is why I had to select "other". edit: now manually changed to 8.0.10].

Steps to Reproduce

  1. add the following xaml to any page
<Button
               FontSize="18.75"
               HeightRequest="60"
               HorizontalOptions="Fill"
               Text="Button with height request set"
               TextTransform="Uppercase">
               <Button.ImageSource>
                   <FontImageSource Glyph="A" />
               </Button.ImageSource>
           </Button>
           <Button
               FontSize="18.75"
               HorizontalOptions="Fill"
               Text="Button without height request"
               TextTransform="Uppercase">
               <Button.ImageSource>
                   <FontImageSource Glyph="A" />
               </Button.ImageSource>
           </Button>
  1. Expected:
    image
  2. Observed:
    image

Link to public reproduction project repository

No response

Version with bug

8.0.10

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.7 SR2

Affected platforms

Windows

Affected platform versions

No response

Did you find any workaround?

Using MinimumHeightRequest instead of HeightRequest stops this issue.
image

Relevant log output

No response

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions