diff options
author | wout <wout@impinc.co.uk> | 2012-12-17 16:55:16 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2012-12-17 16:55:16 +0100 |
commit | 6a013f19d6fa84e538d31bca5f1466c5f3479630 (patch) | |
tree | 3807acc4240bb1dbd5f25406b262a240351fa67a /src/defs.js | |
parent | 9ba8a780e0da4de4839df119f1d57d7f6327b1c6 (diff) | |
download | svg.js-6a013f19d6fa84e538d31bca5f1466c5f3479630.tar.gz svg.js-6a013f19d6fa84e538d31bca5f1466c5f3479630.zip |
Refactored code for readability and size
Diffstat (limited to 'src/defs.js')
-rw-r--r-- | src/defs.js | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/defs.js b/src/defs.js index 4661a54..4c252a5 100644 --- a/src/defs.js +++ b/src/defs.js @@ -1,17 +1,23 @@ + SVG.Defs = function Defs() { - this.constructor.call(this, SVG.createElement('defs')); + this.constructor.call(this, SVG.create('defs')); }; // inherit from SVG.Element SVG.Defs.prototype = new SVG.Element(); -// define clippath -SVG.Defs.prototype.clipPath = function() { - var e = new SVG.ClipPath(); - this.add(e); +// include the container object +SVG.Utils.merge(SVG.Defs, SVG.Container); + +// Add def-specific functions +SVG.Utils.merge(SVG.Defs, { - return e; -}; + // define clippath + clipPath: function() { + var e = new SVG.ClipPath(); + this.add(e); -// include the container object -SVG.Defs.include(SVG.Container);
\ No newline at end of file + return e; + } + +});
\ No newline at end of file |