summaryrefslogtreecommitdiffstats
path: root/src/element.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2012-12-28 23:20:22 +0100
committerwout <wout@impinc.co.uk>2012-12-28 23:20:22 +0100
commita20c0b1430fb97ff203a9afd6ba6945cf18e58d1 (patch)
tree00d3e0f535b52a1dab50f8705b7efcd5a78d033e /src/element.js
parentc8be3da4ddeb80b7ca1a24df07cdca671b35c68a (diff)
downloadsvg.js-a20c0b1430fb97ff203a9afd6ba6945cf18e58d1.tar.gz
svg.js-a20c0b1430fb97ff203a9afd6ba6945cf18e58d1.zip
Added skew method to the sugar module
Diffstat (limited to 'src/element.js')
-rw-r--r--src/element.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/element.js b/src/element.js
index 5a4d4ed..e849867 100644
--- a/src/element.js
+++ b/src/element.js
@@ -110,20 +110,18 @@ SVG.extend(SVG.Element, {
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(' '));
@@ -138,9 +136,11 @@ SVG.extend(SVG.Element, {
// 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