diff options
Diffstat (limited to 'src/wrap.js')
-rw-r--r-- | src/wrap.js | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/wrap.js b/src/wrap.js index d3c6b8f..9fa10a2 100644 --- a/src/wrap.js +++ b/src/wrap.js @@ -14,30 +14,30 @@ SVG.extend(SVG.Wrap, { // Move wrapper around move: function(x, y) { return this.transform({ - x: x, - y: y + x: x + , y: y }) - }, + } // Set the actual size in pixels - size: function(width, height) { +, size: function(width, height) { var scale = width / this._b.width this.child.transform({ - scaleX: scale, - scaleY: height != null ? height / this._b.height : scale + scaleX: scale + , scaleY: height != null ? height / this._b.height : scale }) return this - }, + } // Move by center - center: function(x, y) { +, center: function(x, y) { return this.move( - x + (this._b.width * this.child.trans.scaleX) / -2, - y + (this._b.height * this.child.trans.scaleY) / -2 + x + (this._b.width * this.child.trans.scaleX) / -2 + , y + (this._b.height * this.child.trans.scaleY) / -2 ) - }, + } // Create distributed attr - attr: function(a, v, n) { +, attr: function(a, v, n) { /* call individual attributes if an object is given */ if (typeof a == 'object') { for (v in a) this.attr(v, a[v]) @@ -60,9 +60,9 @@ SVG.extend(SVG.Wrap, { } return this - }, + } // Distribute plot method to child - plot: function(data) { +, plot: function(data) { /* plot new shape */ this.child.plot(data) @@ -71,8 +71,8 @@ SVG.extend(SVG.Wrap, { /* reposition element withing wrapper */ this.child.transform({ - x: -this._b.x, - y: -this._b.y + x: -this._b.x + , y: -this._b.y }) return this |