From 8f03d84e43681ecca20ac028071e51a2e2bbc0c8 Mon Sep 17 00:00:00 2001 From: wout Date: Sun, 9 Jun 2013 11:37:26 +0100 Subject: Added deep traversing, reorganizd modules --- src/clip.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/clip.js') diff --git a/src/clip.js b/src/clip.js index c1e82cb..7341c8f 100644 --- a/src/clip.js +++ b/src/clip.js @@ -5,6 +5,7 @@ SVG.Clip = function() { // Inherit from SVG.Container SVG.Clip.prototype = new SVG.Container +// SVG.extend(SVG.Element, { // Distribute clipPath to svg element clipWith: function(element) { @@ -14,4 +15,13 @@ SVG.extend(SVG.Element, { return this.attr('clip-path', 'url(#' + this.clip.attr('id') + ')') } +}) + +// +SVG.extend(SVG.Container, { + // Create clipping element + clip: function() { + return this.defs().put(new SVG.Clip) + } + }) \ No newline at end of file -- cgit v1.2.3