From ebdf5a2dfda85f4be9972485e51ffe9832146f47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 15 May 2011 19:58:09 +0100 Subject: [PATCH] Shorten CompoundPath#moveBy(). --- src/path/CompoundPath.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/path/CompoundPath.js b/src/path/CompoundPath.js index 9334d92d..8d6103d2 100644 --- a/src/path/CompoundPath.js +++ b/src/path/CompoundPath.js @@ -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() {