office-gobmx/libcdr/libcdr-0.0.10-ellipse.patch
Fridrich Štrba ab0195a5a4 CDR: fix large-angle computation
Change-Id: Ia3f937b0b49093fbdbbe259b835a2d8a81633fe1
2013-01-25 16:23:51 +01:00

19 lines
444 B
Diff

--- a/src/lib/CDRParser.cpp
+++ b/src/lib/CDRParser.cpp
@@ -1186,6 +1186,16 @@ void libcdr::CDRParser::readEllipse(WPXInputStream *input)
double rx = fabs(cx);
double ry = fabs(cy);
+ while (angle1 < 0.0)
+ angle1 += 2*M_PI;
+ while (angle1 > 2*M_PI)
+ angle1 -= 2*M_PI;
+
+ while (angle2 < 0.0)
+ angle2 += 2*M_PI;
+ while (angle2 > 2*M_PI)
+ angle2 -= 2*M_PI;
+
if (angle1 != angle2)
{
if (angle2 < angle1)