From 4e26d2a7d629576564966320f4f351a46fb25978 Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Tue, 21 Jan 2020 10:30:29 +0000 Subject: [PATCH] Don't attempt to rasterize ARCs with very small sweep_angles, just resort to LINETO (#4112) --- deps/agg/src/agg_bezier_arc.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/deps/agg/src/agg_bezier_arc.cpp b/deps/agg/src/agg_bezier_arc.cpp index b39a77fad..08ec67cd7 100644 --- a/deps/agg/src/agg_bezier_arc.cpp +++ b/deps/agg/src/agg_bezier_arc.cpp @@ -22,7 +22,6 @@ #include #include "agg_bezier_arc.h" - namespace agg { @@ -221,15 +220,15 @@ void bezier_arc_svg::init(double x0, double y0, if(v < -1.0) v = -1.0; if(v > 1.0) v = 1.0; double sweep_angle = sign * std::acos(v); + if (std::fabs(sweep_angle) < pi * 1e-6) m_radii_ok = false; if(!sweep_flag && sweep_angle > 0) { sweep_angle -= pi * 2.0; } - else - if (sweep_flag && sweep_angle < 0) - { - sweep_angle += pi * 2.0; - } + else if (sweep_flag && sweep_angle < 0) + { + sweep_angle += pi * 2.0; + } // We can now build and transform the resulting arc //------------------------