diff options
author | wout <wout@impinc.co.uk> | 2012-12-18 19:54:12 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2012-12-18 19:54:12 +0100 |
commit | 1293edb66a5263f8f7064f16f11cbf6b8f550800 (patch) | |
tree | a336fb50db98d52ec8151b494bfa7762128c170e /src/element.js | |
parent | ecc7c2b21cc484a0a57cd7df02a533c65f7bde97 (diff) | |
download | svg.js-1293edb66a5263f8f7064f16f11cbf6b8f550800.tar.gz svg.js-1293edb66a5263f8f7064f16f11cbf6b8f550800.zip |
Separated core from optional libraries
Diffstat (limited to 'src/element.js')
-rw-r--r-- | src/element.js | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/src/element.js b/src/element.js index 39bca21..396d67e 100644 --- a/src/element.js +++ b/src/element.js @@ -9,16 +9,20 @@ SVG.extend(SVG.Element, { // move element to given x and y values move: function(x, y) { - this.attr('x', x); - this.attr('y', y); + this.attr({ + x: x, + y: y + }); return this; }, // set element size to given width and height size: function(w, h) { - this.attr('width', w); - this.attr('height', h); + this.attr({ + width: w, + height: h + }); return this; }, @@ -27,14 +31,14 @@ SVG.extend(SVG.Element, { remove: function() { return this.parent != null ? this.parent.remove(this) : void 0; }, - + // get parent document parentDoc: function() { return this._parent(SVG.Doc); }, // get parent svg wrapper - parentSVG: function() { + mother: function() { return this.parentDoc(); }, @@ -71,6 +75,7 @@ SVG.extend(SVG.Element, { for (var i = 0, s = l.length; i < s; i++) if (!r.test(l[i])) n.push(l[i]); + } else n = l; @@ -91,19 +96,6 @@ SVG.extend(SVG.Element, { return b; }, - // clip element using another element - clip: function(block) { - var p = this.parentSVG().defs().clipPath(); - block(p); - - return this.clipTo(p); - }, - - // distribute clipping path to svg element - clipTo: function(p) { - return this.attr('clip-path', 'url(#' + p.id + ')'); - }, - // private: find svg parent _parent: function(pt) { var e = this; |