summaryrefslogtreecommitdiffstats
path: root/src/path.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2012-12-17 16:55:16 +0100
committerwout <wout@impinc.co.uk>2012-12-17 16:55:16 +0100
commit6a013f19d6fa84e538d31bca5f1466c5f3479630 (patch)
tree3807acc4240bb1dbd5f25406b262a240351fa67a /src/path.js
parent9ba8a780e0da4de4839df119f1d57d7f6327b1c6 (diff)
downloadsvg.js-6a013f19d6fa84e538d31bca5f1466c5f3479630.tar.gz
svg.js-6a013f19d6fa84e538d31bca5f1466c5f3479630.zip
Refactored code for readability and size
Diffstat (limited to 'src/path.js')
-rw-r--r--src/path.js17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/path.js b/src/path.js
index c064a91..ee4484f 100644
--- a/src/path.js
+++ b/src/path.js
@@ -1,13 +1,18 @@
SVG.Path = function Path() {
- this.constructor.call(this, SVG.createElement('path'));
+ this.constructor.call(this, SVG.create('path'));
};
// inherit from SVG.Shape
SVG.Path.prototype = new SVG.Shape();
-// set path data
-SVG.Path.prototype.data = function(d) {
- this.setAttribute('d', d);
- return this;
-}; \ No newline at end of file
+// Add path-specific functions
+SVG.Utils.merge(SVG.Path, {
+
+ // set path data
+ data: function(d) {
+ this.attr('d', d);
+ return this;
+ }
+
+}); \ No newline at end of file