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

Android Border with RoundRectangle Stroke does not correctly round corners of things within it #21173

Closed
jonmdev opened this issue Mar 13, 2024 · 2 comments · Fixed by #21250
Closed
Assignees
Labels
area-controls-border Border area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing fixed-in-8.0.60 i/regression This issue described a confirmed regression on a currently supported version platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@jonmdev
Copy link

jonmdev commented Mar 13, 2024

Description

A Border with a RoundRectangle stroke looks like this in Windows (correct):

clip bug windows

But this in Android (incorrect):

clip bug android

You can see in Android the corners of the red Image contained within are not being rounded like they should be.

This was not an issue in .NET 7.0 but is an issue in .NET 8.0

Steps to Reproduce

  1. Create a Project
  2. Change App.xaml.cs to the following and build in Windows vs. Android:
public partial class App : Application {
    public App() {

        ContentPage page = new();
        MainPage = page;
        page.BackgroundColor = Colors.DeepSkyBlue;
        AbsoluteLayout abs = new();
        page.Content = abs;

        AbsoluteLayout mainAbs = new();
        abs.Add(mainAbs);

        Border border = new();
        border.TranslationX = border.TranslationY = 20;
        border.WidthRequest = border.HeightRequest = 100;
        border.Stroke = Colors.White;
        border.BackgroundColor = Colors.White;
        border.StrokeThickness = 9;
        border.StrokeShape = new RoundRectangle() { CornerRadius = 16 };
        mainAbs.Add(border);

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

        Image image = new();
        image.WidthRequest = image.HeightRequest = 200;
        image.BackgroundColor = Colors.Red;
        borderAbs.Add(image);

    }
}

Link to public reproduction project repository

https://github.com/jonmdev/AndroidBorderCornerBug

Version with bug

8.0.3 GA

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

7.0.101

Affected platforms

Android

@jsuarezruiz

@jonmdev jonmdev added the t/bug Something isn't working label Mar 13, 2024
@kevinxufei
Copy link
Collaborator

Verified this issue with Visual Studio 17.10.0 Preview 2. Can repro on Android platform with sample project.

@kevinxufei kevinxufei added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Mar 13, 2024
@PureWeen PureWeen added platform/android 🤖 area-controls-border Border potential-regression This issue described a possible regression on a currently supported version., verification pending labels Mar 13, 2024
@PureWeen PureWeen added this to the Backlog milestone Mar 13, 2024
kubaflo added a commit to kubaflo/maui that referenced this issue Mar 17, 2024
kubaflo added a commit to kubaflo/maui that referenced this issue Mar 17, 2024
@PureWeen PureWeen modified the milestones: Backlog, .NET 8 SR4, .NET 8 SR5 Mar 17, 2024
@Phenek
Copy link

Phenek commented Mar 28, 2024

Yeah still #7521

@Eilon Eilon added the area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing label Mar 28, 2024
@PureWeen PureWeen modified the milestones: .NET 8 SR5, .NET 8 SR6 Apr 25, 2024
@PureWeen PureWeen modified the milestones: .NET 8 SR6, .NET 8 SR7 Jun 3, 2024
mattleibow added a commit that referenced this issue Jun 7, 2024
* [Android] Border with RoundRectangle (#21173)

* Added a UiTest (#21173)

* Added pending snapshots

* Updated snapshots

* Updated test

* Added UITest for Issue19877

* Added snapshot

* Fix tests

---------

Co-authored-by: Javier Suárez <javiersuarezruiz@hotmail.com>
Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
@samhouts samhouts added fixed-in-8.0.60 i/regression This issue described a confirmed regression on a currently supported version and removed potential-regression This issue described a possible regression on a currently supported version., verification pending labels Jul 1, 2024
@samhouts samhouts modified the milestones: .NET 8 SR7, .NET 8 SR6 Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-border Border area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing fixed-in-8.0.60 i/regression This issue described a confirmed regression on a currently supported version platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

7 participants