diff options
author | wout <wout@impinc.co.uk> | 2012-12-19 13:44:52 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2012-12-19 13:44:52 +0100 |
commit | dfa324f1cb9c562a198ad2f9909bbb8d44807936 (patch) | |
tree | fe84b03e7e7b60c1eb965244defc4bc86e41b222 /src | |
parent | dab421143cf719370cb3739d07e3e411d555cf3c (diff) | |
download | svg.js-dfa324f1cb9c562a198ad2f9909bbb8d44807936.tar.gz svg.js-dfa324f1cb9c562a198ad2f9909bbb8d44807936.zip |
Updated readme
Diffstat (limited to 'src')
-rw-r--r-- | src/element.js | 18 | ||||
-rw-r--r-- | src/sugar.js | 8 |
2 files changed, 5 insertions, 21 deletions
diff --git a/src/element.js b/src/element.js index 396d67e..35464ad 100644 --- a/src/element.js +++ b/src/element.js @@ -9,22 +9,12 @@ SVG.extend(SVG.Element, { // move element to given x and y values move: function(x, y) { - this.attr({ - x: x, - y: y - }); - - return this; + return this.attr({ x: x, y: y }); }, // set element size to given width and height size: function(w, h) { - this.attr({ - width: w, - height: h - }); - - return this; + return this.attr({ width: w, height: h }); }, // remove element @@ -81,9 +71,7 @@ SVG.extend(SVG.Element, { n.push(t); - this.attr('transform', n.join(' ')); - - return this; + return this.attr('transform', n.join(' ')); }, // get bounding box diff --git a/src/sugar.js b/src/sugar.js index a9e1458..dda1aa3 100644 --- a/src/sugar.js +++ b/src/sugar.js @@ -42,9 +42,7 @@ SVG.extend(SVG.Element, { if (o.x == null) o.x = b.cx; if (o.y == null) o.y = b.cy; - this.transform('rotate(' + (o.deg || 0) + ' ' + o.x + ' ' + o.y + ')', o.absolute); - - return this; + return this.transform('rotate(' + (o.deg || 0) + ' ' + o.x + ' ' + o.y + ')', o.absolute); } }); @@ -54,9 +52,7 @@ SVG.extend(SVG.G, { // move using translate move: function(x, y) { - this.transform('translate(' + x + ' ' + y + ')', true); - - return this; + return this.transform('translate(' + x + ' ' + y + ')', true); } }); |