Implement wxPolygonFillMode in GDI+ and D2D graphics contexts

Honour "fillStyle" parameter, which was previously ignored.

Closes https://github.com/wxWidgets/wxWidgets/pull/1478
This commit is contained in:
Maarten Bent
2019-08-11 22:29:28 +02:00
committed by Vadim Zeitlin
parent 4b227835ac
commit d10ed0b991
2 changed files with 27 additions and 11 deletions

View File

@@ -1857,7 +1857,7 @@ void wxGDIPlusContext::StrokeLines( size_t n, const wxPoint2DDouble *points)
}
}
void wxGDIPlusContext::DrawLines( size_t n, const wxPoint2DDouble *points, wxPolygonFillMode WXUNUSED(fillStyle) )
void wxGDIPlusContext::DrawLines( size_t n, const wxPoint2DDouble *points, wxPolygonFillMode fillStyle )
{
if (m_composition == wxCOMPOSITION_DEST)
return;
@@ -1871,7 +1871,8 @@ void wxGDIPlusContext::DrawLines( size_t n, const wxPoint2DDouble *points, wxPol
} // for (int i = 0; i < n; i++)
if ( !m_brush.IsNull() )
m_context->FillPolygon( ((wxGDIPlusBrushData*)m_brush.GetRefData())->GetGDIPlusBrush() , cpoints , n ) ;
m_context->FillPolygon( ((wxGDIPlusBrushData*)m_brush.GetRefData())->GetGDIPlusBrush() , cpoints , n ,
fillStyle == wxODDEVEN_RULE ? FillModeAlternate : FillModeWinding ) ;
if ( !m_pen.IsNull() )
m_context->DrawLines( ((wxGDIPlusPenData*)m_pen.GetGraphicsData())->GetGDIPlusPen() , cpoints , n ) ;
delete[] cpoints;