Fixed a crash when drawing a single point polyline
This commit is contained in:
parent
904ae200e8
commit
7a5f72c948
|
@ -589,7 +589,7 @@ void OPENGL_GAL::DrawRectangle( const VECTOR2D& aStartPoint, const VECTOR2D& aEn
|
|||
|
||||
void OPENGL_GAL::DrawPolyline( const std::deque<VECTOR2D>& aPointList )
|
||||
{
|
||||
if( aPointList.empty() )
|
||||
if( aPointList.size() < 2 )
|
||||
return;
|
||||
|
||||
currentManager->Color( strokeColor.r, strokeColor.g, strokeColor.b, strokeColor.a );
|
||||
|
@ -617,6 +617,9 @@ void OPENGL_GAL::DrawPolyline( const std::deque<VECTOR2D>& aPointList )
|
|||
|
||||
void OPENGL_GAL::DrawPolyline( const VECTOR2D aPointList[], int aListSize )
|
||||
{
|
||||
if( aListSize < 2 )
|
||||
return;
|
||||
|
||||
currentManager->Color( strokeColor.r, strokeColor.g, strokeColor.b, strokeColor.a );
|
||||
|
||||
// Start from the second point
|
||||
|
|
Loading…
Reference in New Issue