diff --git a/interface/wx/graphics.h b/interface/wx/graphics.h index ec6bfa7200..82911df352 100644 --- a/interface/wx/graphics.h +++ b/interface/wx/graphics.h @@ -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); diff --git a/src/msw/graphics.cpp b/src/msw/graphics.cpp index db7037457a..729c19d21c 100644 --- a/src/msw/graphics.cpp +++ b/src/msw/graphics.cpp @@ -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(path); + const GraphicsPath* grPath = static_cast(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 )