mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-04 03:45:58 -05:00
Further clean up.
Instead of removing temporary data structure, clone Segment.
This commit is contained in:
parent
31a45bad97
commit
1e8947af63
1 changed files with 3 additions and 8 deletions
|
@ -165,19 +165,14 @@ PathItem.inject(new function() {
|
||||||
segment.setHandleIn(last ? last._handleIn : Point.create(0, 0));
|
segment.setHandleIn(last ? last._handleIn : Point.create(0, 0));
|
||||||
do {
|
do {
|
||||||
segment._visited = true;
|
segment._visited = true;
|
||||||
if (segment._intersection) {
|
if (segment._intersection && segment._invalid) {
|
||||||
var next = segment._invalid
|
var next = segment._intersection.getSegment(true);
|
||||||
? segment._intersection.getSegment(true)
|
|
||||||
: segment;
|
|
||||||
path.add(new Segment(segment._point, segment._handleIn,
|
path.add(new Segment(segment._point, segment._handleIn,
|
||||||
next._handleOut));
|
next._handleOut));
|
||||||
next._visited = true;
|
next._visited = true;
|
||||||
segment = next;
|
segment = next;
|
||||||
} else {
|
} else {
|
||||||
// Remove temporary digraph data structures from segment
|
path.add(segment.clone());
|
||||||
delete segment._invalid;
|
|
||||||
delete segment._intersection;
|
|
||||||
path.add(segment);
|
|
||||||
}
|
}
|
||||||
segment = segment.getNext();
|
segment = segment.getNext();
|
||||||
} while (segment && !segment._visited && segment !== last);
|
} while (segment && !segment._visited && segment !== last);
|
||||||
|
|
Loading…
Reference in a new issue