diff options
Diffstat (limited to 'playgrounds/transforms/transforms.js')
-rw-r--r-- | playgrounds/transforms/transforms.js | 18 |
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() |