Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit 0b6bfd5

Browse files
authored
Fixed wrong RoundRectangleGeometry calculation (#12286) fixes #12285
1 parent 588e02e commit 0b6bfd5

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Xamarin.Forms.Controls/GalleryPages/ShapesGalleries/ClipGallery.xaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@
4141
Rect="0, 15, 150, 150" />
4242
</Image.Clip>
4343
</Image>
44+
<Label
45+
Text="Clipped Image using RoundRectangleGeometry"/>
46+
<Image
47+
Source="crimson.jpg">
48+
<Image.Clip>
49+
<RoundRectangleGeometry
50+
CornerRadius="6"
51+
Rect="0, 15, 150, 150" />
52+
</Image.Clip>
53+
</Image>
4454
<Label
4555
Text="Clipped Image using EllipseGeometry"/>
4656
<Image

Xamarin.Forms.Core/Shapes/RoundRectangleGeometry.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Geometry GetRoundRectangleGeometry()
6161

6262
if (CornerRadius.TopLeft > 0)
6363
roundedRectGeometry.Children.Add(
64-
new EllipseGeometry(new Point(Rect.Location.X + CornerRadius.TopLeft, Rect.Location.Y + CornerRadius.TopLeft), Rect.Location.Y + CornerRadius.TopLeft, Rect.Location.Y + CornerRadius.TopLeft));
64+
new EllipseGeometry(new Point(Rect.Location.X + CornerRadius.TopLeft, Rect.Location.Y + CornerRadius.TopLeft), CornerRadius.TopLeft, CornerRadius.TopLeft));
6565

6666
if (CornerRadius.TopRight > 0)
6767
roundedRectGeometry.Children.Add(

0 commit comments

Comments
 (0)