From 0855bc6256918ac88ea7d03365252db8a6623d69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Sua=CC=81rez=20Ruiz?= Date: Wed, 8 Sep 2021 14:17:25 +0200 Subject: [PATCH] If stroke is null avoid render a shape stroke --- .../Issue14286.xaml | 25 +++++++++++++++ .../Issue14286.xaml.cs | 31 +++++++++++++++++++ ...rin.Forms.Controls.Issues.Shared.projitems | 4 +++ .../Shapes/ShapeRenderer.cs | 2 +- 4 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue14286.xaml create mode 100644 Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue14286.xaml.cs diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue14286.xaml b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue14286.xaml new file mode 100644 index 00000000000..53ee9824e7a --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue14286.xaml @@ -0,0 +1,25 @@ + + + + + \ No newline at end of file diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue14286.xaml.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue14286.xaml.cs new file mode 100644 index 00000000000..e72c0a1440c --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue14286.xaml.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using Xamarin.Forms.CustomAttributes; +using System.Threading.Tasks; + +#if UITEST +using Xamarin.UITest; +using NUnit.Framework; +using Xamarin.Forms.Core.UITests; +#endif + +namespace Xamarin.Forms.Controls.Issues +{ + [Issue(IssueTracker.Github, 14286, + "[Bug] ShapesAPI-based Circle shape has a border by default in iOS while it doesn't have a border in Android", + PlatformAffected.Android)] + public partial class Issue14286 : TestContentPage + { + public Issue14286() + { +#if APP + InitializeComponent(); +#endif + } + + protected override void Init() + { + } + } +} \ No newline at end of file diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems index 6c81a07b64a..b757623eda2 100644 --- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems @@ -1767,6 +1767,7 @@ + @@ -2211,6 +2212,9 @@ MSBuild:UpdateDesignTimeXaml + + MSBuild:UpdateDesignTimeXaml + diff --git a/Xamarin.Forms.Platform.iOS/Shapes/ShapeRenderer.cs b/Xamarin.Forms.Platform.iOS/Shapes/ShapeRenderer.cs index 687b5dde564..89b2add418d 100644 --- a/Xamarin.Forms.Platform.iOS/Shapes/ShapeRenderer.cs +++ b/Xamarin.Forms.Platform.iOS/Shapes/ShapeRenderer.cs @@ -474,7 +474,7 @@ void RenderShape(CGContext graphics) CATransaction.Begin(); CATransaction.DisableActions = true; - graphics.SetLineWidth(_strokeWidth); + graphics.SetLineWidth(_stroke != null ? _strokeWidth : 0); graphics.SetLineDash(_dashOffset * _strokeWidth, _strokeDash); graphics.SetLineCap(_strokeLineCap); graphics.SetLineJoin(_strokeLineJoin);