Shorten CompoundPath#moveBy().

This commit is contained in:
Jürg Lehni 2011-05-15 19:58:09 +01:00
parent 54161f81f1
commit ebdf5a2dfd

View file

@ -89,11 +89,9 @@ var CompoundPath = this.CompoundPath = PathItem.extend({
path.moveTo.apply(path, arguments);
},
moveBy: function() {
var point = arguments.length ? Point.read(arguments) : new Point(),
path = getCurrentPath(this),
current = path.segments[path.segments.length - 1]._point;
this.moveTo(current.add(point));
moveBy: function(point) {
this.moveTo(getCurrentPath(this).getLastSegment()._point.add(
Point.read(arguments)));
},
closePath: function() {