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.
This commit is contained in:
Artur Wieczorek
2019-08-11 19:38:46 +02:00
parent 8e41677989
commit 283ac3096d

View File

@@ -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 )
{