dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.03k stars 1.73k forks source link

Buttons with images not cropping correctly on screen resize on macOS if using ContentLayout #15003

Open jknaudt21 opened 1 year ago

jknaudt21 commented 1 year ago

Description

Creating a button with an ImageSource and ContentLayout="Right" and then resizing the screen will cause unwanted behavior on MacOS. It seems the image is not moving with the screen, but it is cropping out the text as if it were. If the window size gets too small, some items will appear and disappear

Note: This does bug does not repro if using a left-oriented content layout.

https://github.com/dotnet/maui/assets/32918747/941eb457-3a2a-42cb-a65d-add8967327d8

Steps to Reproduce

  1. Build MAUI using the latest in main
  2. Add this code to the sandbox:
    <StackLayout>
            <Button Text="Some random text that I've typed to occupy space"
                    BackgroundColor="AliceBlue"
                    ImageSource="dotnet_bot.png"
                    TextColor="Black"
                    CharacterSpacing="1.5"
                    ContentLayout="Right"
                    />
    </StackLayout>
  3. Build and deploy on MacCatalyst

Link to public reproduction project repository

(see repro steps)

Version with bug

8.0 previews

Last version that worked well

6.0.312

Affected platforms

macOS

Affected platform versions

MacOS

Did you find any workaround?

No response

Relevant log output

No response

ghost commented 1 year ago

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

XamlTest commented 10 months ago

Verified this on Visual Studio Enterprise 17.9.0 Preview 1(8.0.3). Repro on MacCatalyst, not repro on Windows 11 with below Project: 15003.zip