[Windows] Fix FontImageSource resize behavior#21212
Conversation
| if (nativeImage.Source is CanvasImageSource canvas) | ||
| { | ||
| nativeImage.Width = canvas.Size.Width; | ||
| nativeImage.Height = canvas.Size.Height; | ||
| } |
There was a problem hiding this comment.
I feel like I reviewed a PR weeks ago that removed all the measuring code here - from normal images and things.
There was a problem hiding this comment.
This commit: 7dff6eb#diff-e34feff8430d43e27f52abff099ba347b41628f6bde6a68e12f8b618722c59c9
Should this rather have been implemented differently instead of just being removed?
There was a problem hiding this comment.
Yeah, you did 🥲. I misunderstood the behavior of how FontImageSource scales-to-fit the available space, which differs from how images in buttons scale-to-fit.
| @@ -3,36 +3,82 @@ | |||
| xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |||
| x:Class="Maui.Controls.Sample.Issues.Issue18242" | |||
| Title="Issue 18242"> | |||
There was a problem hiding this comment.
Maybe this should be a new page? I just finished up the Android fixes and if there are 2 columns this page will be too narrow and cramped for a good test on android/ios
There was a problem hiding this comment.
Yeah, that's probably a good idea.
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <EmbeddedResource Include="Resources\Fonts\OpenSans-Regular.ttf" /> |
There was a problem hiding this comment.
Maybe this should just be <MauiFont> ?
There was a problem hiding this comment.
Non-packaged app fonts won't work if they're set to MauiFont
There was a problem hiding this comment.
should be fixed now - we merged the win2d updates.
But it is fine if we want this to run on older branches.
|
/rebase |
66bbbe4 to
a44ad41
Compare
|
UI Tests all passed. |
Description of Change
Images should always set their size to the size of
FontImageSource/CanvasImageSourceas this is established behavior for Maui/Xamarin.Image + Button Resize Rules
FontImageSource/CanvasImageSourceregardless of if they're in a button or notFontImageSource/CanvasImageSourceIssues Fixed
Fixes #21202
Fixes #20648