summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2014-02-03 21:44:34 +0100
committerwout <wout@impinc.co.uk>2014-02-03 21:44:34 +0100
commit8dcb37d3406a85ef639e31b256823cf24fd7b7c6 (patch)
tree3c926ea927e63c7b4e4eb1dbd5befd9f06fa8e54 /src
parent78bbbfebcf6a2b2e17e46f395cf665c932957f36 (diff)
downloadsvg.js-8dcb37d3406a85ef639e31b256823cf24fd7b7c6.tar.gz
svg.js-8dcb37d3406a85ef639e31b256823cf24fd7b7c6.zip
Added `length()`method to path
Diffstat (limited to 'src')
-rwxr-xr-xsrc/path.js4
1 files changed, 4 insertions, 0 deletions
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