The Birdfont Source Code


All Repositories / birdfont.git / commit – 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
author Johan Mattsson <johan.mattsson.m@gmail.com>
Sun, 10 Jul 2016 19:09:39 +0000 (21:09 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Sun, 10 Jul 2016 19:09:39 +0000 (21:09 +0200)
commit e7bf6ed56780cf45757da82bce241e7e260965cd
tree 689fff7108c73de54471364fd9263824df70dbf1
parent 0663b6789ac16c29e64e5dc3b1feba4142bcc0fa
Fix nan angles in arcs

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 (); }