diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue4606.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue4606.cs index 76de7a4351e..c568b644ba7 100644 --- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue4606.cs +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue4606.cs @@ -84,6 +84,54 @@ protected override void Init() Source = "coffee.png" } } + }, + new Label() + { + Text = "The box view height should match the button border width" + }, + new BoxView() + { + BackgroundColor = Color.Red, + HeightRequest = 2 + }, + new Button() + { + BorderColor = Color.Red, + BackgroundColor = Color.White, + CornerRadius = 25, + BorderWidth = 2 + }, + new Label() + { + Text = "The box view height should match the button border width" + }, + new BoxView() + { + BackgroundColor = Color.Red, + HeightRequest = 5 + }, + new Button() + { + BorderColor = Color.Red, + BackgroundColor = Color.White, + CornerRadius = 25, + BorderWidth = 5 + }, + new Label() + { + Text = "The box view height should match the button border width" + }, + new BoxView() + { + BackgroundColor = Color.Red, + HeightRequest = 1 + }, + new Button() + { + BorderColor = Color.Red, + BackgroundColor = Color.White, + CornerRadius = 25, + BorderWidth = 1 } } }; diff --git a/Xamarin.Forms.Platform.Android/Renderers/BorderDrawable.cs b/Xamarin.Forms.Platform.Android/Renderers/BorderDrawable.cs index 14afb56746c..70881a199f8 100644 --- a/Xamarin.Forms.Platform.Android/Renderers/BorderDrawable.cs +++ b/Xamarin.Forms.Platform.Android/Renderers/BorderDrawable.cs @@ -240,8 +240,8 @@ public void DrawCircle(Canvas canvas, int width, int height, Action fini // adjust border radius so outer edge of stroke is same radius as border radius of background float borderRadius = Math.Max(ConvertCornerRadiusToPixels() - inset, 0); - RectF rect = new RectF(0, 0, width, height); - rect.Inset(inset + PaddingLeft, inset + PaddingTop); + RectF rect = new RectF(0, 0, width , height); + rect.Inset(PaddingLeft, PaddingTop); path.AddRoundRect(rect, borderRadius, borderRadius, Path.Direction.Ccw); canvas.Save();