mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 14:10:14 -05:00
Clean up Path#join() code.
This commit is contained in:
parent
0c9914285f
commit
c123468d7a
1 changed files with 6 additions and 4 deletions
|
@ -1184,12 +1184,13 @@ var Path = PathItem.extend(/** @lends Path# */{
|
|||
last2 = path.getLastSegment();
|
||||
if (last1._point.equals(last2._point))
|
||||
path.reverse();
|
||||
var first2 = path.getFirstSegment();
|
||||
var first1,
|
||||
first2 = path.getFirstSegment();
|
||||
if (last1._point.equals(first2._point)) {
|
||||
last1.setHandleOut(first2._handleOut);
|
||||
this._add(segments.slice(1));
|
||||
} else {
|
||||
var first1 = this.getFirstSegment();
|
||||
first1 = this.getFirstSegment();
|
||||
if (first1._point.equals(first2._point))
|
||||
path.reverse();
|
||||
last2 = path.getLastSegment();
|
||||
|
@ -1204,8 +1205,9 @@ var Path = PathItem.extend(/** @lends Path# */{
|
|||
if (path.closed)
|
||||
this._add([segments[0]]);
|
||||
path.remove();
|
||||
// Close if they touch in both places
|
||||
var first1 = this.getFirstSegment();
|
||||
// Close if they touch in both places. Fetch the segments again
|
||||
// since they may have changed.
|
||||
first1 = this.getFirstSegment();
|
||||
last1 = this.getLastSegment();
|
||||
if (last1._point.equals(first1._point)) {
|
||||
first1.setHandleIn(last1._handleIn);
|
||||
|
|
Loading…
Reference in a new issue