From fab6d0e757133519e5a96016886fcc8cbeafbf8a Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 6 May 2016 18:51:00 +0200 Subject: [PATCH] Fixed closing sub-path of wxGraphicsPath with GDI+ renderer. Close sub-path only if it is really open. --- src/msw/graphics.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/msw/graphics.cpp b/src/msw/graphics.cpp index fbb6375a39..0c78abbdfd 100644 --- a/src/msw/graphics.cpp +++ b/src/msw/graphics.cpp @@ -1227,13 +1227,16 @@ void wxGDIPlusPathData::AddLineToPoint( wxDouble x , wxDouble y ) void wxGDIPlusPathData::CloseSubpath() { - m_path->CloseFigure(); - m_figureOpened = false; - // Since native GDI+ renderer doesn't move its current point - // to the starting point of the figure we need to maintain - // it on our own in this case. - m_logCurrentPoint = m_figureStart; - m_logCurrentPointSet = true; + if( m_figureOpened ) + { + m_path->CloseFigure(); + m_figureOpened = false; + // Since native GDI+ renderer doesn't move its current point + // to the starting point of the figure we need to maintain + // it on our own in this case. + m_logCurrentPoint = m_figureStart; + m_logCurrentPointSet = true; + } } void wxGDIPlusPathData::AddCurveToPoint( wxDouble cx1, wxDouble cy1, wxDouble cx2, wxDouble cy2, wxDouble x, wxDouble y )