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