diff options
Diffstat (limited to 'src/mask.js')
-rw-r--r-- | src/mask.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mask.js b/src/mask.js index c33b93a..708b982 100644 --- a/src/mask.js +++ b/src/mask.js @@ -1,21 +1,21 @@ -SVG.Mask = function Mask() { - this.constructor.call(this, SVG.create('mask')); +SVG.Mask = function() { + this.constructor.call(this, SVG.create('mask')) /* set unique id */ - this.attr('id', (this.id = 'svgjs_element_' + (SVG.did++))); -}; + this.attr('id', (this.id = 'svgjs_element_' + (SVG.did++))) +} // Inherit from SVG.Container -SVG.Mask.prototype = new SVG.Container(); +SVG.Mask.prototype = new SVG.Container SVG.extend(SVG.Element, { // Distribute mask to svg element maskWith: function(element) { /* use given mask or create a new one */ - this.mask = element instanceof SVG.Mask ? element : this.parent.mask().add(element); + this.mask = element instanceof SVG.Mask ? element : this.parent.mask().add(element) - return this.attr('mask', 'url(#' + this.mask.id + ')'); + return this.attr('mask', 'url(#' + this.mask.id + ')') } -});
\ No newline at end of file +})
\ No newline at end of file |