mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Path: After calling Path#add(segment), return the added segment. Add todo to Path#insert.
This commit is contained in:
parent
9496ac70bd
commit
c6d606db0a
1 changed files with 3 additions and 0 deletions
|
@ -200,8 +200,11 @@ Path = PathItem.extend({
|
||||||
var segment = Segment.read(arguments);
|
var segment = Segment.read(arguments);
|
||||||
if (segment)
|
if (segment)
|
||||||
this.addSegment(segment);
|
this.addSegment(segment);
|
||||||
|
return segment;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// TODO: make sure that if the segment belongs to another path, it clones
|
||||||
|
// the segment. Otherwise it returns the same segment.
|
||||||
insert: function(index, segment) {
|
insert: function(index, segment) {
|
||||||
this._segments.splice(index, 0, new Segment(segment));
|
this._segments.splice(index, 0, new Segment(segment));
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue