diff options
author | wout <wout@impinc.co.uk> | 2013-06-09 11:37:26 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2013-06-09 11:37:26 +0100 |
commit | 8f03d84e43681ecca20ac028071e51a2e2bbc0c8 (patch) | |
tree | f5c11dc6c429e8459c20731ba775fa6ca794400f /src/mask.js | |
parent | ec75128ec31aa055aca2ae7f95ad4f5cf38d12e0 (diff) | |
download | svg.js-8f03d84e43681ecca20ac028071e51a2e2bbc0c8.tar.gz svg.js-8f03d84e43681ecca20ac028071e51a2e2bbc0c8.zip |
Added deep traversing, reorganizd modules
Diffstat (limited to 'src/mask.js')
-rw-r--r-- | src/mask.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mask.js b/src/mask.js index 12fc13b..ddd7565 100644 --- a/src/mask.js +++ b/src/mask.js @@ -5,6 +5,7 @@ SVG.Mask = function() { // Inherit from SVG.Container SVG.Mask.prototype = new SVG.Container +// SVG.extend(SVG.Element, { // Distribute mask to svg element maskWith: function(element) { @@ -14,4 +15,13 @@ SVG.extend(SVG.Element, { return this.attr('mask', 'url(#' + this.mask.attr('id') + ')') } +}) + +// +SVG.extend(SVG.Container, { + // Create masking element + mask: function() { + return this.defs().put(new SVG.Mask) + } + })
\ No newline at end of file |