The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Remove tripple points on other points

These changes was commited to the Birdfont repository Wed, 06 Jul 2016 21:33:12 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Wed, 06 Jul 2016 21:33:12 +0000]

Updated Files

libbirdfont/Path.vala
--- a/libbirdfont/Path.vala +++ b/libbirdfont/Path.vala @@ -2266,8 +2266,12 @@ for (int i = 0; i < points.size + 1; i++) { EditPoint ep = points.get (i % points.size); n = points.get ((i + 1) % points.size); + EditPoint previous = points.get ((i - 1 + points.size) % points.size); - if (Path.distance_to_point (n, ep) < t) { + if (Path.distance_to_point (n, ep) < t && Path.distance_to_point (previous, ep) < t) { + points.remove (ep); + i--; + } else if (Path.distance_to_point (n, ep) < t) { remove.add (ep); } }