From f619cbed484c49f9cae052e1e4eded2d163ee648 Mon Sep 17 00:00:00 2001 From: Benedikt Schroeder Date: Tue, 18 Sep 2018 08:57:33 +0200 Subject: [PATCH] Fix code style --- src/Avalonia.Controls/Utils/BorderRenderHelper.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Avalonia.Controls/Utils/BorderRenderHelper.cs b/src/Avalonia.Controls/Utils/BorderRenderHelper.cs index 62867f1d22..628648d090 100644 --- a/src/Avalonia.Controls/Utils/BorderRenderHelper.cs +++ b/src/Avalonia.Controls/Utils/BorderRenderHelper.cs @@ -93,15 +93,19 @@ namespace Avalonia.Controls.Utils if (background != null) { - var innerRect = new Rect(new Point(borders.Left, borders.Top), new Point(size.Width - borders.Right, size.Height - borders.Bottom)); - context.DrawRectangle(new Pen(background, borderThickness), innerRect, cornerRadius); + var topLeft = new Point(borders.Left, borders.Top); + var bottomRight = new Point(size.Width - borders.Right, size.Height - borders.Bottom); + var innerRect = new Rect(topLeft, bottomRight); + context.DrawRectangle(new Pen(background), innerRect, cornerRadius); context.FillRectangle(background, innerRect, cornerRadius); } if (borderBrush != null && borderThickness > 0) { var top = borderThickness * 0.5; - var outerRect = new Rect(new Point(top, top), new Point(size.Width - top, size.Height - top)); + var topLeft = new Point(top, top); + var bottomRight = new Point(size.Width - top, size.Height - top); + var outerRect = new Rect(topLeft, bottomRight); context.DrawRectangle(new Pen(borderBrush, borderThickness), outerRect, (float)radii.TopLeft); } }