maui
maui copied to clipboard
Issue in Clipping Images in Border
Description
1)Images are not perfectly fit as expected....In Android, Images are perfectly clipped without CornerRadius Only, but In Windows Images are not cropped correctly i.e see the below differences between android and windows
In Android without CornerRadius Works perfect

In Windows without CornerRadius not work as expected
- Likewise by giving Corner Radius , Images are not perfectly fit in both android and windows, see the screenshots below
In Android by Giving Corner Radius, there is small gap in top and left side

In Windows by Giving Corner Radius, Images are not totally clipped inside the border
Steps to Reproduce
1.Unzip the below project , I gave Corner Radius . Check with Corner Radius and also without Corner Radius in both Android and windows
- Run the Project
Version with bug
Unknown/Other (please specify)
Last version that worked well
Unknown/Other
Affected platforms
Android, Windows
Affected platform versions
Android 9.0 and Windows10.0.19041.0
Did you find any workaround?
No
Relevant log output
No
@Redth I think we have an interesting topic to discuss here.
Border is a special container where can define the border with an IShape. IShape only has the information needed to define a specific Shape (no Stroke, etc). However, when exposing IShape we use Shapes API (which implement ShapeView by exposing Stroke and many other properties). Similarly, Geometry implements IShape.
This leaves us with two ways to set the Stroke Shape:
<Border.StrokeShape>
<RoundRectangleGeometry Rect="1,1,99,99" CornerRadius="50" />
</Border.StrokeShape>
<Border.StrokeShape>
<RoundRectangle CornerRadius="50" />
</Border.StrokeShape>
We really had in mind to allow defining StrokeShape with IShape, but without properties like Stroke (Brush) or sizing (because the size is inherited from Border). But we don't have an ideal clean option. Using Geometry we must make adjustments to validate all cases. We can limit to using some specific type, or create a specific type.
We have a similar feedback here: https://github.com/dotnet/maui/issues/3558
Verified this issue with Visual Studio Enterprise 17.3.0 Preview 1.0 [32427.455.main]. Repro on Android and Windows with above project.
I have observed the same issue for lower Border part See code and image below

The same issue occurs in iOS and Maccatalyst.
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
I'm hitting this now too.
Same here. Works on iOS, fails on Android
Same here. Works on iOS, fails on Android
In my case, it works on Android, and fails on IOS.