From b3072cc16beea650d073379552f7bfb76547da10 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 12 Jan 2022 09:44:30 +0100 Subject: [PATCH] SCH_PAINTER, DrawLine: gives a minimal length to lines having a 0 length Lines with start point = end point always create problems in OpenGL (not drawn). --- eeschema/sch_painter.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/eeschema/sch_painter.cpp b/eeschema/sch_painter.cpp index c77ef7d3ce..f44050f16c 100644 --- a/eeschema/sch_painter.cpp +++ b/eeschema/sch_painter.cpp @@ -1326,7 +1326,12 @@ void SCH_PAINTER::draw( const SCH_LINE *aLine, int aLayer ) STROKE_PARAMS::Stroke( &line, lineStyle, width, &m_schSettings, [&]( const VECTOR2I& a, const VECTOR2I& b ) { - m_gal->DrawLine( a, b ); + // DrawLine has problem with 0 length lines + // so draw a line with a minimal length + if( a == b ) + m_gal->DrawLine( a+1, b ); + else + m_gal->DrawLine( a, b ); } ); } } @@ -1429,7 +1434,12 @@ void SCH_PAINTER::draw( const SCH_SHAPE* aShape, int aLayer ) STROKE_PARAMS::Stroke( shape, lineStyle, lineWidth, &m_schSettings, [&]( const VECTOR2I& a, const VECTOR2I& b ) { - m_gal->DrawLine( a, b ); + // DrawLine has problem with 0 length lines + // so draw a line with a minimal length + if( a == b ) + m_gal->DrawLine( a+1, b ); + else + m_gal->DrawLine( a, b ); } ); }