bugfix: OPENGL_GAL::DrawPolygon did not close closed polygons
The polygon drawing routing in the OpenGL-GAL did not plot polygons which are "closed", i.e. have a segment from their last point to their first point, correctly. That segment was omitted. This commit fixes this bug.
This commit is contained in:
parent
df76380a2d
commit
6205363b50
|
@ -826,11 +826,11 @@ void OPENGL_GAL::DrawPolygon( const SHAPE_POLY_SET& aPolySet )
|
|||
for( int j = 0; j < aPolySet.OutlineCount(); ++j )
|
||||
{
|
||||
const SHAPE_LINE_CHAIN& outline = aPolySet.COutline( j );
|
||||
const int pointCount = outline.PointCount();
|
||||
const int pointCount = outline.SegmentCount() + 1;
|
||||
std::unique_ptr<GLdouble[]> points( new GLdouble[3 * pointCount] );
|
||||
GLdouble* ptr = points.get();
|
||||
|
||||
for( int i = 0; i < outline.PointCount(); ++i )
|
||||
for( int i = 0; i < pointCount; ++i )
|
||||
{
|
||||
const VECTOR2I& p = outline.CPoint( i );
|
||||
*ptr++ = p.x;
|
||||
|
|
Loading…
Reference in New Issue