From 81a15379e50b5e11cca0b82bc99c9367cbaea24d Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Wed, 27 Apr 2011 15:49:06 +0200 Subject: [PATCH] Have Path#reverse also reverse the segment handles. --- src/path/Path.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/path/Path.js b/src/path/Path.js index 31b7750f..ee857306 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -159,7 +159,15 @@ var Path = this.Path = PathItem.extend({ * Reverses the segments of the path. */ reverse: function() { - this._segments.reverse(); + var segments = this._segments; + segments.reverse(); + // Reverse the handles: + for (var i = 0, l = segments.length; i < l; i++) { + var segment = segments[i]; + var handleIn = segment._handleIn; + segment._handleIn = segment._handleOut; + segment._handleOut = handleIn; + } }, join: function(path) {