-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Windows] Fix FontImageSource resize behavior #21212
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
Conversation
| if (nativeImage.Source is CanvasImageSource canvas) | ||
| { | ||
| nativeImage.Width = canvas.Size.Width; | ||
| nativeImage.Height = canvas.Size.Height; | ||
| } |
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit: 7dff6eb#diff-e34feff8430d43e27f52abff099ba347b41628f6bde6a68e12f8b618722c59c9
Should this rather have been implemented differently instead of just being removed?
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.
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.
| <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's probably a good idea.
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <EmbeddedResource Include="Resources\Fonts\OpenSans-Regular.ttf" /> |
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.
Maybe this should just be <MauiFont> ?
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.
Non-packaged app fonts won't work if they're set to MauiFont
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.
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