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:
parent
084eea6781
commit
5572183c22
|
@ -1511,32 +1511,37 @@ void OPENGL_GAL::drawStrokedSemiCircle( const VECTOR2D& aCenterPoint, double aRa
|
|||
|
||||
void OPENGL_GAL::drawPolygon( GLdouble* aPoints, int aPointCount )
|
||||
{
|
||||
currentManager->Shader( SHADER_NONE );
|
||||
currentManager->Color( fillColor.r, fillColor.g, fillColor.b, fillColor.a );
|
||||
|
||||
// Any non convex polygon needs to be tesselated
|
||||
// for this purpose the GLU standard functions are used
|
||||
TessParams params = { currentManager, tessIntersects };
|
||||
gluTessBeginPolygon( tesselator, ¶ms );
|
||||
gluTessBeginContour( tesselator );
|
||||
|
||||
GLdouble* point = aPoints;
|
||||
|
||||
for( int i = 0; i < aPointCount; ++i )
|
||||
if( isFillEnabled )
|
||||
{
|
||||
gluTessVertex( tesselator, point, point );
|
||||
point += 3; // 3 coordinates
|
||||
currentManager->Shader( SHADER_NONE );
|
||||
currentManager->Color( fillColor.r, fillColor.g, fillColor.b, fillColor.a );
|
||||
|
||||
// Any non convex polygon needs to be tesselated
|
||||
// for this purpose the GLU standard functions are used
|
||||
TessParams params = { currentManager, tessIntersects };
|
||||
gluTessBeginPolygon( tesselator, ¶ms );
|
||||
gluTessBeginContour( tesselator );
|
||||
|
||||
GLdouble* point = aPoints;
|
||||
|
||||
for( int i = 0; i < aPointCount; ++i )
|
||||
{
|
||||
gluTessVertex( tesselator, point, point );
|
||||
point += 3; // 3 coordinates
|
||||
}
|
||||
|
||||
gluTessEndContour( tesselator );
|
||||
gluTessEndPolygon( tesselator );
|
||||
|
||||
// Free allocated intersecting points
|
||||
tessIntersects.clear();
|
||||
}
|
||||
|
||||
gluTessEndContour( tesselator );
|
||||
gluTessEndPolygon( tesselator );
|
||||
|
||||
// Free allocated intersecting points
|
||||
tessIntersects.clear();
|
||||
|
||||
if( isStrokeEnabled )
|
||||
{
|
||||
drawPolyline( [&](int idx) { return VECTOR2D( aPoints[idx * 3], aPoints[idx * 3 + 1] ); },
|
||||
aPointCount );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue