Skip to content
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

[regression/8.0.0] Windows and Android no longer draw Borders/clipping correctly (previously was okay) #18071

Open
jonmdev opened this issue Oct 17, 2023 · 3 comments
Assignees
Labels
area-controls-border Border platform/android 🤖 platform/windows 🪟 potential-regression This issue described a possible regression on a currently supported version., verification pending s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@jonmdev
Copy link

jonmdev commented Oct 17, 2023

Description

I posted a bug report here regarding .NET 7 iOS not rendering Borders and clipping masks correctly: #17998

I was suggested to try .NET 8 and .NET 8 did fix this in iOS but it has now broken it in Android and Windows.

CORRECT BEHAVIOR:
Here is the correct behavior from .NET 7 Android and also now seen with .NET 8 iOS:
ios border mask bug 2

ABNORMAL BEHAVIOR:
Here is what Windows .NET 8 is now doing (the same thing iOS used to do):
windows border alignment bug

Here is what Android .NET 8 is now doing (new abnormal behavior):
ios border mask bug android 8

So this problem was fixed in iOS from .NET 7 to .NET 8. But it is now broken in Windows and Android, whereas in .NET 7 Windows and Android worked fine.

A unified fix please would be very appreciated, as this function is very basically essential.

Steps to Reproduce

Open bug project, play in various platforms and versions, observe the various behaviors.

Working:

  • .NET 7 Windows, .NET 7 Android, .NET 8 iOS

Broken:

  • .NET 8 Windows, .NET 8 Android, .NET 7 iOS

Link to public reproduction project repository

https://github.com/jonmdev/Border-iOS-Mask-Bug

Repro Code

Replace app.xaml.cs with:

using Microsoft.Maui.Controls.Shapes;

namespace Border_iOS_Mask_Bug {
    public partial class App : Application {
        public App() {
            InitializeComponent();

            ContentPage mainPage = new();
            mainPage.BackgroundColor = Colors.CornflowerBlue;
            this.MainPage = mainPage;

            VerticalStackLayout vert = new();
            mainPage.Content = vert;

            Border border = new();
            border.Stroke = Colors.White;
            border.StrokeThickness = 10;
            //border.Shadow = new Shadow() { Offset = new Point(0, 6), Radius = 7 };
            vert.Add(border);

            AbsoluteLayout abs = new();
            border.Content = abs;

            Image image = new();
            abs.Add(image);
            image.Source = ImageSource.FromResource("Border_iOS_Mask_Bug.Resources.Images.cat.jpg");
            image.Aspect = Aspect.AspectFill;

            //resize function
            mainPage.SizeChanged += delegate {
                if (mainPage.Width > 0) {
                    int width = (int)mainPage.Width ;
                    border.WidthRequest = border.HeightRequest = width * 0.5;
                    image.WidthRequest = image.HeightRequest = width * 0.5;
                    border.StrokeShape = new RoundRectangle() { CornerRadius = width * 0.25 };
                }
            };
        }
    }
}

Version with bug

8.0.0-rc.1.9171

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

7.0.96

Affected platforms

Android, Windows

@jonmdev jonmdev added the t/bug Something isn't working label Oct 17, 2023
@jonmdev jonmdev changed the title New bug in .NET 8: Windows and Android no longer drawing Borders/clipping correctly (previously was okay) New Bug in .NET 8: Windows and Android no longer draw Borders/clipping correctly (previously was okay) Oct 17, 2023
@jsuarezruiz jsuarezruiz added area-controls-border Border potential-regression This issue described a possible regression on a currently supported version., verification pending labels Oct 17, 2023
@ghost ghost added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Oct 17, 2023
@AnnYang01
Copy link
Collaborator

Verified this on Visual Studio Enterprise 17.8.0 Preview 4.0 using below Project (.NET 8.0), This issue repro on .NET 8 Android, not repro on .NET 8 iOS and .NET 8 Windows. dotnet version is 8.0.100-rc.2.23502.2 in my machine.
Border-iOS-Mask-Bug-main.zip
.NET 8 iOS
image
.NET 8 Windows
image
.NET 8 Android
image

@AnnYang01 AnnYang01 added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Oct 18, 2023
@PureWeen PureWeen added this to the .NET 8 GA milestone Oct 18, 2023
@jsuarezruiz jsuarezruiz self-assigned this Oct 19, 2023
@samhouts samhouts changed the title New Bug in .NET 8: Windows and Android no longer draw Borders/clipping correctly (previously was okay) [regression/8.0.0] Windows and Android no longer draw Borders/clipping correctly (previously was okay) Oct 20, 2023
@Redth Redth added partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with and removed partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with labels Oct 25, 2023
@Redth Redth modified the milestones: .NET 8 GA, .NET 8 SR1 Oct 25, 2023
@jonmdev
Copy link
Author

jonmdev commented Mar 3, 2024

Is there any update on getting this fixed?

As per this thread it was not fixed in the attempted fix that was performed:

#18134

In current .NET 8 on Android the round corners are not being drawn correctly still.

@jonmdev
Copy link
Author

jonmdev commented Mar 7, 2024

ie. In Android .NET 8 we still get:

clip1

Where we should get:

clip2

Any help? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-border Border platform/android 🤖 platform/windows 🪟 potential-regression This issue described a possible regression on a currently supported version., verification pending s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants