OPENGL_GAL: ensure 0 sized rect with thickness is shown (already shown by Cairo)

Fixes #15850
https://gitlab.com/kicad/code/kicad/-/issues/15850
This commit is contained in:
jean-pierre charras 2023-10-10 18:29:42 +02:00
parent d8f35633d4
commit 42384bcbd0
1 changed files with 15 additions and 7 deletions

View File

@ -1121,7 +1121,14 @@ void OPENGL_GAL::DrawRectangle( const VECTOR2D& aStartPoint, const VECTOR2D& aEn
m_currentManager->Color( m_strokeColor.r, m_strokeColor.g, m_strokeColor.b,
m_strokeColor.a );
// DrawLine (and DrawPolyline )
// has problem with 0 length lines so enforce minimum
if( aStartPoint == aEndPoint )
DrawLine( aStartPoint + VECTOR2D( 1.0, 0.0 ), aEndPoint );
else
{
std::deque<VECTOR2D> pointList;
pointList.push_back( aStartPoint );
pointList.push_back( diagonalPointA );
pointList.push_back( aEndPoint );
@ -1129,6 +1136,7 @@ void OPENGL_GAL::DrawRectangle( const VECTOR2D& aStartPoint, const VECTOR2D& aEn
pointList.push_back( aStartPoint );
DrawPolyline( pointList );
}
}
}