summaryrefslogtreecommitdiffstats
path: root/src/fx.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2014-08-29 12:45:21 +0200
committerwout <wout@impinc.co.uk>2014-08-29 12:45:21 +0200
commitdd4be62e397e4db78444881eed32865f98e52582 (patch)
treec2300f62c756fde22c80f30aba66dca04602297b /src/fx.js
parent8789391f036ffded3ac919d62ee652e7cae15c5c (diff)
downloadsvg.js-dd4be62e397e4db78444881eed32865f98e52582.tar.gz
svg.js-dd4be62e397e4db78444881eed32865f98e52582.zip
Added SVG.TBox for transformed bounding boxes
Diffstat (limited to 'src/fx.js')
-rwxr-xr-xsrc/fx.js19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/fx.js b/src/fx.js
index 0ba21a2..03e9317 100755
--- a/src/fx.js
+++ b/src/fx.js
@@ -222,13 +222,18 @@ SVG.FX = SVG.invent({
var from = this.target.attr(a)
// detect format
- this.attrs[a] = a == 'transform' ?
- this.target.ctm().morph(v) :
- SVG.Color.isColor(v) ?
- new SVG.Color(from).morph(v) :
- SVG.regex.unit.test(v) ?
- new SVG.Number(from).morph(v) :
- { from: from, to: v }
+ if (a == 'transform') {
+ if (this.attrs[a])
+ v = this.attrs[a].destination.multiply(v)
+
+ this.attrs[a] = this.target.ctm().morph(v)
+ } else {
+ this.attrs[a] = SVG.Color.isColor(v) ?
+ new SVG.Color(from).morph(v) :
+ SVG.regex.unit.test(v) ?
+ new SVG.Number(from).morph(v) :
+ { from: from, to: v }
+ }
}
return this