bugfix: OPENGL_GAL::drawPolygon did not respect fill settings

The OPENGL_GAL::drawPolygon function and all functions using it
did not respect the isFillEnabled member set by
GAL::SetIsFill. This is fixed by this patch.
This commit is contained in:
Andreas Buhr 2017-12-08 12:44:46 +01:00 committed by Maciej Suminski
parent 084eea6781
commit 5572183c22
1 changed files with 25 additions and 20 deletions

View File

@ -1511,6 +1511,8 @@ void OPENGL_GAL::drawStrokedSemiCircle( const VECTOR2D& aCenterPoint, double aRa
void OPENGL_GAL::drawPolygon( GLdouble* aPoints, int aPointCount )
{
if( isFillEnabled )
{
currentManager->Shader( SHADER_NONE );
currentManager->Color( fillColor.r, fillColor.g, fillColor.b, fillColor.a );
@ -1533,10 +1535,13 @@ void OPENGL_GAL::drawPolygon( GLdouble* aPoints, int aPointCount )
// Free allocated intersecting points
tessIntersects.clear();
}
if( isStrokeEnabled )
{
drawPolyline( [&](int idx) { return VECTOR2D( aPoints[idx * 3], aPoints[idx * 3 + 1] ); },
aPointCount );
}
}