summaryrefslogtreecommitdiffstats
path: root/playgrounds
diff options
context:
space:
mode:
authorSaivan <savian@me.com>2018-03-02 23:11:11 +1100
committerSaivan <savian@me.com>2018-03-02 23:11:11 +1100
commit8991bd195817c38e76bdf15accf16cf321ba84cf (patch)
tree1c3b954a82a74176bde18d33fabdab0bb09cff6d /playgrounds
parent25a95447f7f5357150bd18d8b5d0d44b7b61e908 (diff)
downloadsvg.js-8991bd195817c38e76bdf15accf16cf321ba84cf.tar.gz
svg.js-8991bd195817c38e76bdf15accf16cf321ba84cf.zip
All transformations except fx and Transformations are passing now
This commit modifies the specification (and in some places the code) to reflect the changes to the transformations.
Diffstat (limited to 'playgrounds')
-rw-r--r--playgrounds/transforms/transforms.js26
1 files changed, 17 insertions, 9 deletions
diff --git a/playgrounds/transforms/transforms.js b/playgrounds/transforms/transforms.js
index 854c1f4..76045a3 100644
--- a/playgrounds/transforms/transforms.js
+++ b/playgrounds/transforms/transforms.js
@@ -23,19 +23,27 @@ draw = SVG("svg")
offset = draw.screenCTM()
draw.viewbox(100,100, 1000, 1000)
-nested = draw.nested().size(200, 200).move(100,100).viewbox(0, 0, 100, 100)
-rect = nested.rect(50, 50).stroke({width:0}).move(25, 90).scale(2, 0, 0).transform({tx:10, ty:10}, true).fill("red")
+nested = draw.nested().size(500, 500).move(100,100).viewbox(0, 0, 400, 400)
+rect = nested.rect(50, 50).stroke({width:0}).move(25, 90).scale(2, 0, 0).translate(10, 10).fill("red")
+
var box = rect.rbox()
+console.log(box.x - offset.e, box.y - offset.f);
+
+
div = document.createElement('div')
-div.style.position = 'absolute'
-div.style.left = box.x + 'px'
-div.style.top = box.y + 'px'
-div.style.width = box.width + 'px'
-div.style.opacity = 0.4
-div.style.height = box.height + 'px'
-div.style.background = 'blue'
+
+Object.assign(div.style, {
+ position : 'absolute',
+ left : box.x + 'px',
+ top : box.y + 'px',
+ width : box.width + 'px',
+ opacity : 0.4,
+ height : box.height + 'px',
+ background : 'blue',
+})
+
document.body.appendChild(div)