Draw degenerate lines as points

Rather than not drawing, which will miss some imported elements that
should be visible due to the line width, we draw a zero-length line that
appears as a point.
This commit is contained in:
Seth Hillbrand 2022-10-31 16:18:38 -07:00
parent c7c4439027
commit 5be0ddca27
1 changed files with 7 additions and 1 deletions

View File

@ -2181,10 +2181,16 @@ void OPENGL_GAL::drawPolygon( GLdouble* aPoints, int aPointCount )
void OPENGL_GAL::drawPolyline( const std::function<VECTOR2D( int )>& aPointGetter, int aPointCount,
bool aReserve )
{
wxCHECK( aPointCount >= 2, /* return */ );
wxCHECK( aPointCount > 0, /* return */ );
m_currentManager->Color( m_strokeColor.r, m_strokeColor.g, m_strokeColor.b, m_strokeColor.a );
if( aPointCount == 1 )
{
drawLineQuad( aPointGetter( 0 ), aPointGetter( 0 ), false );
return;
}
if( aReserve )
{
reserveLineQuads( aPointCount - 1 );