KEMBAR78
CornerRadius works incorrectly due to wrong parameter order · Issue #13136 · dotnet/maui · GitHub
Skip to content

CornerRadius works incorrectly due to wrong parameter order #13136

@marchev-prgs

Description

@marchev-prgs

Description

In most UI frameworks the values of a CornerRadius are defined in this order - TopLeft, TopRight, BottomRight, BottomLeft. This is so for constructors and parsing from string (take WPF and WinUI for examples).
In Maui the order of the last two is wrong, the order is changed - TopLeft, TopRight, BottomLeft, BottomRight.
This is counter intuitive as other UI related descriptions, such as the Thickness, usually follow a clockwise orientation, where the CornerRadius doesn't. As mentioned earlier - it is different from WPF and WinUI.
This is very problematic for new development as the developer doesn't expect that peculiarity, and this leads to a funky UI.
The order in which the XAML is parsed should be changed, and the parameters in the constructor for the CornerRadius should be changed as well - it should be TopLeft, TopRight, BottomRight, BottomLeft.

Steps to Reproduce

One example is to use a BoxView:

<BoxView WidthRequest="200"
         HeightRequest="40"
         Color="DarkGray"
         CornerRadius="0, 10, 10, 0" />

Actual:
boxview_cornerradius_actual

Expected:
boxview_cornerradius_expected

Note: It is expected for the corners on the right side to be rounded.

Link to public reproduction project repository

https://github.com/telerik/ms-samples/tree/main/Maui/CornerRadiusWrongOrderOfValues

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android, Windows, macOS

Affected platform versions

N/A

Did you find any workaround?

No response

Relevant log output

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions