mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -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));
|
||||
do {
|
||||
segment._visited = true;
|
||||
if (segment._intersection) {
|
||||
var next = segment._invalid
|
||||
? segment._intersection.getSegment(true)
|
||||
: segment;
|
||||
if (segment._intersection && segment._invalid) {
|
||||
var next = segment._intersection.getSegment(true);
|
||||
path.add(new Segment(segment._point, segment._handleIn,
|
||||
next._handleOut));
|
||||
next._visited = true;
|
||||
segment = next;
|
||||
} else {
|
||||
// Remove temporary digraph data structures from segment
|
||||
delete segment._invalid;
|
||||
delete segment._intersection;
|
||||
path.add(segment);
|
||||
path.add(segment.clone());
|
||||
}
|
||||
segment = segment.getNext();
|
||||
} while (segment && !segment._visited && segment !== last);
|
||||
|
|
Loading…
Reference in a new issue