The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Fix nan angles in arcs

These changes was commited to the Birdfont repository Sun, 10 Jul 2016 19:09:39 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Sun, 10 Jul 2016 19:09:39 +0000]

Updated Files

libsvgbird/SvgPath.vala
--- a/libsvgbird/SvgPath.vala +++ b/libsvgbird/SvgPath.vala @@ -130,12 +130,14 @@ angle_start %= 2 * Math.PI; angle_extent %= 2 * Math.PI; - if (angle_extent > 0) { - cr.arc_negative (0, 0, 1, angle_start, angle_start + angle_extent); - } else { - cr.arc (0, 0, 1, angle_start, angle_start + angle_extent); + if (angle_extent.is_normal () && angle_extent.is_normal ()) { + if (angle_extent > 0) { + cr.arc_negative (0, 0, 1, -angle_start, -angle_start - angle_extent); + } else { + cr.arc (0, 0, 1, -angle_start, -angle_start - angle_extent); + } } - + cr.restore (); }