Path: After calling Path#add(segment), return the added segment. Add todo to Path#insert.

This commit is contained in:
Jonathan Puckey 2011-02-27 15:50:41 +01:00
parent 9496ac70bd
commit c6d606db0a

View file

@ -200,8 +200,11 @@ Path = PathItem.extend({
var segment = Segment.read(arguments);
if (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) {
this._segments.splice(index, 0, new Segment(segment));
},