aboutsummaryrefslogtreecommitdiffstats
path: root/playgrounds
diff options
context:
space:
mode:
authorSaivan <savian@me.com>2018-03-02 20:51:26 +1100
committerSaivan <savian@me.com>2018-03-02 20:51:26 +1100
commit25a95447f7f5357150bd18d8b5d0d44b7b61e908 (patch)
tree113b91dd7bb2ba3cd30d9cc54a0301ceb7808371 /playgrounds
parente0964238b0a68c310b94dc26f54951d77503d0c8 (diff)
downloadsvg.js-25a95447f7f5357150bd18d8b5d0d44b7b61e908.tar.gz
svg.js-25a95447f7f5357150bd18d8b5d0d44b7b61e908.zip
Investigating a possible rbox issue when transforming
Diffstat (limited to 'playgrounds')
-rw-r--r--playgrounds/transforms/transforms.js18
1 files changed, 13 insertions, 5 deletions
diff --git a/playgrounds/transforms/transforms.js b/playgrounds/transforms/transforms.js
index f9de24b..854c1f4 100644
--- a/playgrounds/transforms/transforms.js
+++ b/playgrounds/transforms/transforms.js
@@ -21,15 +21,23 @@
draw = SVG("svg")
-
offset = draw.screenCTM()
-draw.viewbox(100,100, 200, 200)
+draw.viewbox(100,100, 1000, 1000)
nested = draw.nested().size(200, 200).move(100,100).viewbox(0, 0, 100, 100)
-rect = nested.rect(50, 180).stroke({width:0}).move(25, 90).scale(2, 0, 0).transform({tx:10, ty:10}, true)
+rect = nested.rect(50, 50).stroke({width:0}).move(25, 90).scale(2, 0, 0).transform({tx:10, ty:10}, true).fill("red")
var box = rect.rbox()
-draw.rect(box.width, box.height).move(box.x, box.y).fill("blue")
-draw.rect(78, 226).move(100, 360).fill("blue")
+
+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'
+
+document.body.appendChild(div)
// rect1.toParent(nested).transform()
// rect2.toParent(g2).transform()