maui icon indicating copy to clipboard operation
maui copied to clipboard

Issue in Clipping Images in Border

Open Ahamed-Ali opened this issue 3 years ago • 6 comments

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 image

In Windows without CornerRadius not work as expected

image
  1. 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 image

In Windows by Giving Corner Radius, Images are not totally clipped inside the border

image

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

SampleGridCheck.zip

  1. 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

Ahamed-Ali avatar May 10 '22 10:05 Ahamed-Ali

@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>

border-type-issue

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.

throw-exc-shape

We have a similar feedback here: https://github.com/dotnet/maui/issues/3558

jsuarezruiz avatar May 10 '22 14:05 jsuarezruiz

Verified this issue with Visual Studio Enterprise 17.3.0 Preview 1.0 [32427.455.main]. Repro on Android and Windows with above project.

XamlTest avatar May 11 '22 03:05 XamlTest

I have observed the same issue for lower Border part See code and image below image

pierre01 avatar May 24 '22 20:05 pierre01

The same issue occurs in iOS and Maccatalyst.

PaulAndersonS avatar May 25 '22 13:05 PaulAndersonS

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.

ghost avatar Aug 30 '22 13:08 ghost

I'm hitting this now too.

sej69 avatar Nov 11 '22 17:11 sej69

Same here. Works on iOS, fails on Android

Visual-IT-2021 avatar Feb 15 '23 08:02 Visual-IT-2021

Same here. Works on iOS, fails on Android

In my case, it works on Android, and fails on IOS.

H-A-Hristov avatar Feb 28 '23 12:02 H-A-Hristov