From 5bdc78e3baae8fd578469e72ba3d463f9975ab0c Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Thu, 30 Jul 2020 15:09:31 -0700 Subject: [PATCH] GAL: Fix issue with small tracks being hidden When drawing segments that are smaller than the segment width, OpenGL did not use realistic values, leading to hidden, small tracks. Instead, we set the track to only draw a segment when the length is at least 1 radius long (so that we can see the full semi-circle at the track end) Fixes https://gitlab.com/kicad/code/kicad/issues/5009 (cherry picked from commit 294dabf6407034dd26a2bd0eed38788a6242d8b3) --- common/gal/opengl/opengl_gal.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index e87522bdff..e50d247e29 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -613,7 +613,8 @@ void OPENGL_GAL::DrawLine( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoin void OPENGL_GAL::DrawSegment( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoint, double aWidth ) { - if( aStartPoint == aEndPoint ) // 0 length segments are just a circle. + // segments less than the radius are just a circle. + if( ( aStartPoint - aEndPoint ).EuclideanNorm() < aWidth / 2.0 ) { DrawCircle( aStartPoint, aWidth/2 ); return;