From 1f7cf04c572c06fa1e6d63c2fb225ab41a745244 Mon Sep 17 00:00:00 2001 From: Patrick Tellier Date: Thu, 2 Jun 2022 14:10:20 +0200 Subject: [PATCH] Use own Pen (if set) in GeometryDrawing.GetBounds --- src/Avalonia.Visuals/Media/GeometryDrawing.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Avalonia.Visuals/Media/GeometryDrawing.cs b/src/Avalonia.Visuals/Media/GeometryDrawing.cs index e46e3a7d5f9..aa12f90f23f 100644 --- a/src/Avalonia.Visuals/Media/GeometryDrawing.cs +++ b/src/Avalonia.Visuals/Media/GeometryDrawing.cs @@ -68,7 +68,8 @@ public override void Draw(DrawingContext context) public override Rect GetBounds() { - return Geometry?.GetRenderBounds(s_boundsPen) ?? Rect.Empty; + IPen pen = Pen ?? s_boundsPen; + return Geometry?.GetRenderBounds(pen) ?? Rect.Empty; } } }