diff options
Diffstat (limited to 'dist/svg.js')
-rw-r--r-- | dist/svg.js | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/dist/svg.js b/dist/svg.js index 6a90a89..d8c2b48 100644 --- a/dist/svg.js +++ b/dist/svg.js @@ -1,4 +1,4 @@ -/* svg.js v0.1-34-gd976188 - svg container element group arrange defs clip gradient doc shape rect circle ellipse path image text sugar - svgjs.com/license */ +/* svg.js v0.1-37-gc8be3da - svg container element group arrange defs clip gradient doc shape rect circle ellipse path image text sugar - svgjs.com/license */ (function() { this.SVG = { @@ -256,20 +256,18 @@ t.push('rotate(' + o.rotation + ',' + (o.cx != null ? o.cx : b.cx) + ',' + (o.cy != null ? o.cy : b.cy) + ')'); // add scale - if (o.scaleX != 1 && o.scaleY != 1) - t.push('scale(' + o.sx + ',' + o.sy + ')'); + t.push('scale(' + o.scaleX + ',' + o.scaleY + ')'); // add skew on x axis if (o.skewX != 0) - t.push('skewX(' + x.skewX + ')'); + t.push('skewX(' + o.skewX + ')'); // add skew on y axis if (o.skewY != 0) - t.push('skewY(' + x.skewY + ')') + t.push('skewY(' + o.skewY + ')') // add translate - if (o.x != 0 && o.y != 0) - t.push('translate(' + o.x + ',' + o.y + ')'); + t.push('translate(' + o.x + ',' + o.y + ')'); // add only te required transformations return this.attr('transform', t.join(' ')); @@ -284,9 +282,11 @@ // include translations on x an y x: b.x + this.trans.x, y: b.y + this.trans.y, + // add the center - cx: b.x + this.trans.x + b.width / 2, + cx: b.x + this.trans.x + b.width / 2, cy: b.y + this.trans.y + b.height / 2, + // plain width and height width: b.width, height: b.height @@ -615,8 +615,8 @@ var r = this.attrs.r || 0; return this.attr({ - cx: (x || ((this.attrs.x || 0) + r)), - cy: (y || ((this.attrs.y || 0) + r)) + cx: x || (this.attrs.x || 0) + r, + cy: y || (this.attrs.y || 0) + r }); } @@ -813,6 +813,14 @@ cx: x == null ? b.cx : x, cy: y == null ? b.cx : y }); + }, + + // skew + skew: function(x, y) { + return this.transform({ + skewX: x || 0, + skewY: y || 0 + }); } }); |