summaryrefslogtreecommitdiffstats
path: root/src/clip.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2013-01-01 21:39:25 +0100
committerwout <wout@impinc.co.uk>2013-01-01 21:39:25 +0100
commit88987d60c456f1e686edd226f4ccb45e35142cd7 (patch)
tree719bd1c6ea1e18bae81ea9a8083742184eb422e9 /src/clip.js
parent5e7c26e9423f3c543e04bc9a11656125ec7bf8ca (diff)
downloadsvg.js-88987d60c456f1e686edd226f4ccb45e35142cd7.tar.gz
svg.js-88987d60c456f1e686edd226f4ccb45e35142cd7.zip
Replaced clip() in favor of mask()
Some browsers had issues with clipping, masking was a better option.
Diffstat (limited to 'src/clip.js')
-rw-r--r--src/clip.js42
1 files changed, 0 insertions, 42 deletions
diff --git a/src/clip.js b/src/clip.js
deleted file mode 100644
index ab7bebf..0000000
--- a/src/clip.js
+++ /dev/null
@@ -1,42 +0,0 @@
-
-SVG.Clip = function Clip() {
- this.constructor.call(this, SVG.create('clipPath'));
-
- // set unique id
- this.id = 'svgjs_' + (SVG.did++);
- this.attr('id', this.id);
-};
-
-// inherit from SVG.Element
-SVG.Clip.prototype = new SVG.Element();
-
-// include the container object
-SVG.extend(SVG.Clip, SVG.Container);
-
-// add clipping functionality to element
-SVG.extend(SVG.Element, {
-
- // clip element using another element
- clip: function(b) {
- var p = this.parent.defs().clip();
- b(p);
-
- return this.clipTo(p);
- },
-
- // distribute clipping path to svg element
- clipTo: function(p) {
- return this.attr('clip-path', 'url(#' + p.id + ')');
- }
-
-});
-
-// add def-specific functions
-SVG.extend(SVG.Defs, {
-
- // create clippath
- clip: function() {
- return this.put(new SVG.Clip());
- }
-
-}); \ No newline at end of file