aboutsummaryrefslogtreecommitdiffstats
path: root/src/clip.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/clip.js')
-rw-r--r--src/clip.js17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/clip.js b/src/clip.js
index 2266adb..ddc2588 100644
--- a/src/clip.js
+++ b/src/clip.js
@@ -18,9 +18,9 @@ SVG.extend(SVG.Clip, SVG.Container);
SVG.extend(SVG.Element, {
// clip element using another element
- clip: function(block) {
+ clip: function(b) {
var p = this.mother().defs().clipPath();
- block(p);
+ b(p);
return this.clipTo(p);
},
@@ -31,3 +31,16 @@ SVG.extend(SVG.Element, {
}
});
+
+// add def-specific functions
+SVG.extend(SVG.Defs, {
+
+ // define clippath
+ clipPath: function() {
+ var e = new SVG.Clip();
+ this.add(e);
+
+ return e;
+ }
+
+}); \ No newline at end of file