Fixed wxGraphicsPath concatenation with GDI+ renderer.

Since resulting wxGraphicPath should have the same state as appended path so we have to grab in wxGraphicsPath::AddPath also auxiliary data from appended wxGraphicsPath.

See #17532
This commit is contained in:
Artur Wieczorek
2016-05-12 21:13:47 +02:00
parent 4eababc004
commit 08cb54c4c1
2 changed files with 14 additions and 5 deletions

View File

@@ -96,7 +96,8 @@ public:
void AddLineToPoint(const wxPoint2DDouble& p);
/**
Adds another path.
Adds another path onto the current path. After this call the current
point will be at the added path's current point.
*/
virtual void AddPath(const wxGraphicsPath& path);

View File

@@ -1327,11 +1327,19 @@ void wxGDIPlusPathData::AddRectangle( wxDouble x, wxDouble y, wxDouble w, wxDoub
void wxGDIPlusPathData::AddPath( const wxGraphicsPathData* path )
{
m_path->AddPath( (GraphicsPath*) path->GetNativePath(), FALSE);
// We have to switch to the native current point.
m_logCurrentPointSet = false;
}
const wxGDIPlusPathData* pathData = static_cast<const wxGDIPlusPathData*>(path);
const GraphicsPath* grPath = static_cast<const GraphicsPath*>(pathData->GetNativePath());
m_path->AddPath(grPath, FALSE);
// Copy auxiliary data if appended path is non-empty.
if( grPath->GetPointCount() > 0 || pathData->m_logCurrentPointSet || pathData->m_figureOpened )
{
m_logCurrentPointSet = pathData->m_logCurrentPointSet;
m_logCurrentPoint = pathData->m_logCurrentPoint;
m_figureOpened = pathData->m_figureOpened;
m_figureStart = pathData->m_figureStart;
}
}
// transforms each point of this path by the matrix
void wxGDIPlusPathData::Transform( const wxGraphicsMatrixData* matrix )