From 8dcb37d3406a85ef639e31b256823cf24fd7b7c6 Mon Sep 17 00:00:00 2001 From: wout Date: Mon, 3 Feb 2014 21:44:34 +0100 Subject: Added `length()`method to path --- src/path.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/path.js b/src/path.js index 4ce57f6..76ef1ba 100755 --- a/src/path.js +++ b/src/path.js @@ -37,6 +37,10 @@ SVG.Path = SVG.invent({ , height: function(height) { return height == null ? this.bbox().height : this.size(this.bbox().width, height) } + // Get path length + , length: function() { + return this.node.getTotalLength() + } } // Add parent method -- cgit v1.2.3