diff options
author | wout <wout@impinc.co.uk> | 2012-12-29 18:12:53 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2012-12-29 18:12:53 +0100 |
commit | 68367e494fcab754ae4833e64804a824032cf31c (patch) | |
tree | c9d5d9fe5995ccbbe819f29752c1133c7415882d /src/clip.js | |
parent | 52ed3ba98715ed3c63e74ff29a9892972a7bec19 (diff) | |
download | svg.js-68367e494fcab754ae4833e64804a824032cf31c.tar.gz svg.js-68367e494fcab754ae4833e64804a824032cf31c.zip |
Code refactoring
Diffstat (limited to 'src/clip.js')
-rw-r--r-- | src/clip.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/clip.js b/src/clip.js index 9b106b4..6d820df 100644 --- a/src/clip.js +++ b/src/clip.js @@ -4,6 +4,8 @@ var clipID = 0; SVG.Clip = function Clip() { this.constructor.call(this, SVG.create('clipPath')); + + // set unique id this.id = 'svgjs_clip_' + (clipID++); this.attr('id', this.id); }; @@ -35,12 +37,9 @@ SVG.extend(SVG.Element, { // add def-specific functions SVG.extend(SVG.Defs, { - // define clippath + // create clippath clip: function() { - var e = new SVG.Clip(); - this.add(e); - - return e; + return this.put(new SVG.Clip()); } });
\ No newline at end of file |