From bd55ce4d37706272a791e7bf15039df9f6ffc883 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Thu, 12 May 2016 21:33:49 +0200 Subject: [PATCH] Fixed closing sub-path of wxGraphicsPath with Direct2D renderer. To ensure compatibility with Cairo renderer the new sub-path should be started at the joined endpoint of the current (just closed) sub-path. Closes #17532 --- src/msw/graphicsd2d.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/msw/graphicsd2d.cpp b/src/msw/graphicsd2d.cpp index 02325df817..4f92f48653 100644 --- a/src/msw/graphicsd2d.cpp +++ b/src/msw/graphicsd2d.cpp @@ -1371,7 +1371,11 @@ void wxD2DPathData::AddPath(const wxGraphicsPathData* path) void wxD2DPathData::CloseSubpath() { // Close sub-path and close the figure. - EndFigure(D2D1_FIGURE_END_CLOSED); + if ( m_figureOpened ) + { + EndFigure(D2D1_FIGURE_END_CLOSED); + MoveToPoint(m_figureStart.x, m_figureStart.y); + } } void* wxD2DPathData::GetNativePath() const