diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index a94ef0ea40..e4455d7619 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -978,7 +978,7 @@ void OPENGL_GAL::DrawPolyline( const SHAPE_LINE_CHAIN& aLineChain ) void OPENGL_GAL::DrawPolygon( const std::deque& aPointList ) { - wxCHECK( aPointList.size() > 2, /* void */ ); + wxCHECK( aPointList.size() >= 2, /* void */ ); auto points = std::unique_ptr( new GLdouble[3 * aPointList.size()] ); GLdouble* ptr = points.get(); @@ -995,7 +995,7 @@ void OPENGL_GAL::DrawPolygon( const std::deque& aPointList ) void OPENGL_GAL::DrawPolygon( const VECTOR2D aPointList[], int aListSize ) { - wxCHECK( aListSize > 2, /* void */ ); + wxCHECK( aListSize >= 2, /* void */ ); auto points = std::unique_ptr( new GLdouble[3 * aListSize] ); GLdouble* target = points.get(); const VECTOR2D* src = aPointList; @@ -1094,7 +1094,7 @@ void OPENGL_GAL::DrawPolygon( const SHAPE_POLY_SET& aPolySet ) void OPENGL_GAL::DrawPolygon( const SHAPE_LINE_CHAIN& aPolygon ) { - wxCHECK( aPolygon.PointCount() > 2, /* void */ ); + wxCHECK( aPolygon.PointCount() >= 2, /* void */ ); const int pointCount = aPolygon.SegmentCount() + 1; std::unique_ptr points( new GLdouble[3 * pointCount] );