diff options
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 |