diff options
author | wout <wout@impinc.co.uk> | 2013-01-04 19:12:16 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2013-01-04 19:12:16 +0100 |
commit | 2380c67d4ddded556617760b4b3cb38a1d7758e2 (patch) | |
tree | c0bd5ee57a4c83e5d8860becba7766188344eda3 /src/mask.js | |
parent | 40de19951d0a4218ee2625fa9a1a69f04e79692d (diff) | |
download | svg.js-2380c67d4ddded556617760b4b3cb38a1d7758e2.tar.gz svg.js-2380c67d4ddded556617760b4b3cb38a1d7758e2.zip |
Made code more readable and included docs
Diffstat (limited to 'src/mask.js')
-rw-r--r-- | src/mask.js | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/mask.js b/src/mask.js index 19f5562..b5baa14 100644 --- a/src/mask.js +++ b/src/mask.js @@ -1,24 +1,22 @@ - SVG.Mask = function Mask() { this.constructor.call(this, SVG.create('mask')); - // set unique id + /* set unique id */ this.id = 'svgjs_' + (SVG.did++); this.attr('id', this.id); }; -// inherit from SVG.Element +// Inherit from SVG.Element SVG.Mask.prototype = new SVG.Element(); -// include the container object +// Include the container object SVG.extend(SVG.Mask, SVG.Container); -// add clipping functionality to element SVG.extend(SVG.Element, { - // distribute mask to svg element - maskWith: function(e) { - return this.attr('mask', 'url(#' + (e instanceof SVG.Mask ? e : this.parent.mask().add(e)).id + ')'); + // Distribute mask to svg element + maskWith: function(element) { + return this.attr('mask', 'url(#' + (element instanceof SVG.Mask ? element : this.parent.mask().add(element)).id + ')'); } });
\ No newline at end of file |