aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2014-08-24 16:32:30 +0200
committerwout <wout@impinc.co.uk>2014-08-24 16:32:30 +0200
commit7c195432d30bf2c179d2f5c2682b85d76ef9458b (patch)
tree885243ee58281acc3b46933d32a60b2fa1f7570f /README.md
parent0a91c3dffc11e823487f5ce2265ebddfc08fe03b (diff)
downloadsvg.js-7c195432d30bf2c179d2f5c2682b85d76ef9458b.tar.gz
svg.js-7c195432d30bf2c179d2f5c2682b85d76ef9458b.zip
Updated README
Diffstat (limited to 'README.md')
-rwxr-xr-xREADME.md15
1 files changed, 13 insertions, 2 deletions
diff --git a/README.md b/README.md
index 06f671e..4481437 100755
--- a/README.md
+++ b/README.md
@@ -1108,9 +1108,20 @@ rect.attr('fill', null)
### transform()
-The `transform()` method acts as a full getter without an argument. Basically it calls `element.ctm().extract()`.
+The `transform()` method acts as a full getter without an argument. Basically it calls:
+
+```javascript
+element.ctm().extract()
+```
+
+As a setter it has two ways of working. By default transformations are absolute. For example, if you call:
+
+```javascript
+element.transform({ rotation: 125 }).transform({ rotation: 37.5 })
+```
+
+The resulting rotation will be `37.5` and not the sum of the two transformations. But if that's what you want there is a way out by adding the `relative` parameter. That would be:
-As a setter it has two ways of working. By default transformations are absolute. For example, if you call `element.transform({ rotation: 125 }).transform({ rotation: 37.5 })` the resulting rotation will be `37.5` and not the sum of the two transformations. But if that's what you want there is a way out by adding the `add` parameter. That would be:
```javascript
element.transform({ rotation: 125 }).transform({ rotation: 37.5, relative: true })