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 fixed-in-9.0.0-preview.6.24327.7 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

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 moved this from Todo to Possible in MAUI SDK Ongoing Apr 24, 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 <[email protected]>
Co-authored-by: Matthew Leibowitz <[email protected]>
@github-project-automation github-project-automation bot moved this from Possible to Done in MAUI SDK Ongoing Jun 7, 2024
@samhouts samhouts added 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
@github-actions github-actions bot locked and limited conversation to collaborators Aug 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-border Border area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing fixed-in-8.0.60 fixed-in-9.0.0-preview.6.24327.7 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