mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-28 17:02:24 -05:00
Add insert function for PathItem
This commit is contained in:
parent
0c53c8b29e
commit
0d1f0bf5a1
1 changed files with 4 additions and 1 deletions
|
@ -57,6 +57,9 @@ PathItem = Item.extend(new function() {
|
|||
this.addSegment(segment);
|
||||
},
|
||||
|
||||
insert: function(index, segment) {
|
||||
this.segments.splice(index, 0, new Segment(segment));
|
||||
},
|
||||
|
||||
moveTo: function() {
|
||||
var segment = Segment.read(arguments);
|
||||
|
@ -361,7 +364,7 @@ PathItem = Item.extend(new function() {
|
|||
}
|
||||
cp1 = handleOut;
|
||||
}
|
||||
if(this.closed) {
|
||||
if(this.closed && this.segments.length > 1) {
|
||||
var segment = this.segments[0];
|
||||
var point = segment.point;
|
||||
var handleIn = segment.handleIn ? segment.handleIn.add(point) : point;
|
||||
|
|
Loading…
Reference in a new issue