From f43efa6b46caf091bb9f354080a12ee6aec3002e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 20 May 2022 01:32:07 +0200 Subject: [PATCH] Fix drawing of corners in wxGraphicsContext::DrawLines() Close the path corresponding to the polygon to ensure that the starting and finishing edges are joined correctly, which wasn't the case before as could be easily seen when using thicker pens. Closes #22440. --- src/common/graphcmn.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/graphcmn.cpp b/src/common/graphcmn.cpp index f03d1f7dec..00c64e9ca0 100644 --- a/src/common/graphcmn.cpp +++ b/src/common/graphcmn.cpp @@ -835,6 +835,7 @@ void wxGraphicsContext::DrawLines( size_t n, const wxPoint2DDouble *points, wxPo path.MoveToPoint(points[0].m_x, points[0].m_y); for ( size_t i = 1; i < n; ++i) path.AddLineToPoint( points[i].m_x, points[i].m_y ); + path.CloseSubpath(); DrawPath( path , fillStyle); }