Don't attempt to rasterize ARCs with very small sweep_angles, just resort to LINETO (#4112)
This commit is contained in:
parent
0420b13055
commit
4e26d2a7d6
1 changed files with 5 additions and 6 deletions
5
deps/agg/src/agg_bezier_arc.cpp
vendored
5
deps/agg/src/agg_bezier_arc.cpp
vendored
|
@ -22,7 +22,6 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "agg_bezier_arc.h"
|
#include "agg_bezier_arc.h"
|
||||||
|
|
||||||
|
|
||||||
namespace agg
|
namespace agg
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -221,12 +220,12 @@ void bezier_arc_svg::init(double x0, double y0,
|
||||||
if(v < -1.0) v = -1.0;
|
if(v < -1.0) v = -1.0;
|
||||||
if(v > 1.0) v = 1.0;
|
if(v > 1.0) v = 1.0;
|
||||||
double sweep_angle = sign * std::acos(v);
|
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)
|
if(!sweep_flag && sweep_angle > 0)
|
||||||
{
|
{
|
||||||
sweep_angle -= pi * 2.0;
|
sweep_angle -= pi * 2.0;
|
||||||
}
|
}
|
||||||
else
|
else if (sweep_flag && sweep_angle < 0)
|
||||||
if (sweep_flag && sweep_angle < 0)
|
|
||||||
{
|
{
|
||||||
sweep_angle += pi * 2.0;
|
sweep_angle += pi * 2.0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue