Various changes on #isLinear(), #hasHandles() & co

Relates to 

- Implement #hasHandles() on Path, Segment and Curve
- Remove Path#isPolygon()
- Define #isLinear() consistently across Path, Segment and Curve.
- Introduce new Segment#isStraight()
This commit is contained in:
Jürg Lehni 2015-08-17 14:31:23 +02:00
parent 97ca1f6ff8
commit f8314f927e
6 changed files with 99 additions and 40 deletions

View file

@ -465,12 +465,11 @@ PathItem.inject(new function() {
// Add the path to the result, while avoiding stray segments and
// incomplete paths. The amount of segments for valid paths depend
// on their geometry:
// - Closed paths with only straight lines (polygons) need more than
// two segments.
// - Closed paths with curves can consist of only one segment.
// - Open paths need at least two segments.
// - Closed paths with only straight lines need more than 2 segments
// - Closed paths with curves can consist of only one segment
// - Open paths need at least two segments
if (path._segments.length >
(path._closed ? path.isPolygon() ? 2 : 0 : 1))
(path._closed ? path.isLinear() ? 2 : 0 : 1))
paths.push(path);
}
return paths;