diff --git a/common/gal/cairo/cairo_gal.cpp b/common/gal/cairo/cairo_gal.cpp index 7913912fbd..bcec4cd34e 100644 --- a/common/gal/cairo/cairo_gal.cpp +++ b/common/gal/cairo/cairo_gal.cpp @@ -245,6 +245,7 @@ void CAIRO_GAL_BASE::DrawCircle( const VECTOR2D& aCenterPoint, double aRadius ) auto c = roundp( xform( aCenterPoint ) ); auto r = ::roundp( xform( aRadius ) ); + cairo_set_line_width( currentContext, std::min( 2.0 * r, lineWidthInPixels ) ); cairo_new_sub_path( currentContext ); cairo_arc( currentContext, c.x, c.y, r, 0.0, 2 * M_PI ); cairo_close_path( currentContext ); diff --git a/common/gal/opengl/gl_builtin_shaders.cpp b/common/gal/opengl/gl_builtin_shaders.cpp index 21bd36e898..d837cb9f76 100644 --- a/common/gal/opengl/gl_builtin_shaders.cpp +++ b/common/gal/opengl/gl_builtin_shaders.cpp @@ -333,12 +333,11 @@ int isPixelInSegment( vec2 aCoord ) void strokedCircle( vec2 aCoord, float aRadius, float aWidth ) { - float outerRadius = max( aRadius + ( aWidth / 2 ), 0.0 ); - float innerRadius = max( aRadius - ( aWidth / 2 ), 0.0 ); - float relWidth = innerRadius / outerRadius; + float outerRadius = max( aRadius, 0.0 ); + float innerRadius = max( aRadius - aWidth, 0.0 ); if( ( dot( aCoord, aCoord ) < 1.0 ) && - ( dot( aCoord, aCoord ) > relWidth * relWidth ) ) + ( dot( aCoord, aCoord ) * ( outerRadius * outerRadius ) > innerRadius * innerRadius ) ) gl_FragColor = gl_Color; else discard;