From 2d7a2a965804eeb1c84427c2d26be6f92ff9b645 Mon Sep 17 00:00:00 2001 From: Mikolaj Wielgus Date: Tue, 29 Sep 2020 01:22:49 +0200 Subject: [PATCH] Fix grid dots not appearing due to below-unity drawing width Fixes https://gitlab.com/kicad/code/kicad/-/issues/5630 --- common/gal/cairo/cairo_gal.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/gal/cairo/cairo_gal.cpp b/common/gal/cairo/cairo_gal.cpp index 92429f856c..3d48b723b2 100644 --- a/common/gal/cairo/cairo_gal.cpp +++ b/common/gal/cairo/cairo_gal.cpp @@ -36,6 +36,7 @@ #include // for KiROUND #include +#include #include #include @@ -1017,7 +1018,7 @@ void CAIRO_GAL_BASE::drawGridCross( const VECTOR2D& aPoint ) void CAIRO_GAL_BASE::drawGridPoint( const VECTOR2D& aPoint, double aSize ) { auto p = roundp( xform( aPoint ) ); - auto s = xform( aSize / 2.0 ); + auto s = std::max( 1.0, xform( aSize / 2.0 ) ); cairo_set_source_rgba( currentContext, gridColor.r, gridColor.g, gridColor.b, gridColor.a ); cairo_move_to( currentContext, p.x, p.y );