From 283ac3096ddd431b19b36eeb903ba9ed31bcb674 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 11 Aug 2019 19:38:46 +0200 Subject: [PATCH] Fix closing sub-path created by MoveToPoint() in Direct2D Because call to MoveToPoint() opens a new sub-path but doesn't open a new D2D figure (this is to avoid the situation when multiple consequtive calls to MoveToPoint() would open a spurious figures/paths, see c8fe811636), we need to check when sub-path is being closed if we have a sub-patch without figure and if so, a new figure has to be open to get a required in this case 1-point figure/path. --- src/msw/graphicsd2d.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/msw/graphicsd2d.cpp b/src/msw/graphicsd2d.cpp index ceda198f64..de24c1f9e1 100644 --- a/src/msw/graphicsd2d.cpp +++ b/src/msw/graphicsd2d.cpp @@ -1813,6 +1813,13 @@ void wxD2DPathData::AddPath(const wxGraphicsPathData* path) // closes the current sub-path void wxD2DPathData::CloseSubpath() { + // If we have a sub-path open by call to MoveToPoint(), + // which doesn't open a new figure by itself, + // we have to open a new figure now to get a required 1-point path. + if ( !m_figureOpened && m_currentPointSet ) + { + EnsureFigureOpen(m_currentPoint); + } // Close sub-path and close the figure. if ( m_figureOpened ) {