From 43ba49285bfd8a407bde59beaf9dd9d33a30de00 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 8 May 2016 19:46:04 +0200 Subject: [PATCH] Fixed closing sub-path of wxGraphicsPath with Direct2D renderer. Ensure that sub-path being closed contains at least one point. Closes #17525 --- src/msw/graphicsd2d.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/msw/graphicsd2d.cpp b/src/msw/graphicsd2d.cpp index 06a5ba98b0..8ecccb3f8e 100644 --- a/src/msw/graphicsd2d.cpp +++ b/src/msw/graphicsd2d.cpp @@ -1145,6 +1145,10 @@ void wxD2DPathData::EndFigure(D2D1_FIGURE_END figureEnd) { if (m_figureOpened) { + // Ensure that sub-path being closed contains at least one point. + if( figureEnd == D2D1_FIGURE_END_CLOSED ) + m_geometrySink->AddLine(m_currentPoint); + m_geometrySink->EndFigure(figureEnd); m_figureOpened = false;