aboutsummaryrefslogtreecommitdiffstats
path: root/playgrounds/transforms
diff options
context:
space:
mode:
authorSaivan <savian@me.com>2018-03-02 19:54:01 +1100
committerSaivan <savian@me.com>2018-03-02 19:54:01 +1100
commite0964238b0a68c310b94dc26f54951d77503d0c8 (patch)
tree0d01d483f1e61561686bd2ce6adcaa337cf598fd /playgrounds/transforms
parent1cba40f6a039d8ff0b87043b5cb9e1f28b3655ee (diff)
downloadsvg.js-e0964238b0a68c310b94dc26f54951d77503d0c8.tar.gz
svg.js-e0964238b0a68c310b94dc26f54951d77503d0c8.zip
Fixed a few more specifications regarding the new transforms
Diffstat (limited to 'playgrounds/transforms')
-rw-r--r--playgrounds/transforms/transforms.html6
-rw-r--r--playgrounds/transforms/transforms.js17
2 files changed, 19 insertions, 4 deletions
diff --git a/playgrounds/transforms/transforms.html b/playgrounds/transforms/transforms.html
index 58eb5dc..d206d06 100644
--- a/playgrounds/transforms/transforms.html
+++ b/playgrounds/transforms/transforms.html
@@ -12,11 +12,11 @@
<h1>SVG JS Playground</h1>
- <svg viewBox="0 0 1400 1000">
+ <svg viewBox="0 0 2000 2000">
- <rect id="old" x=200 y=400 width=200 height=400 class="green"/>
+ <!-- <rect id="old" x=200 y=400 width=200 height=400 class="green"/>
<rect id="new" x=200 y=400 width=200 height=400 class="pink"/>
- <ellipse id="new" cx=800 cy=500 rx=10 ry=10 class="dark-pink"/>
+ <ellipse id="new" cx=800 cy=500 rx=10 ry=10 class="dark-pink"/> -->
<!-- <ellipse cx=0 cy=0 rx=3 ry=3 />
<ellipse cx=100 cy=0 rx=3 ry=3 />
<ellipse cx=0 cy=100 rx=3 ry=3 />
diff --git a/playgrounds/transforms/transforms.js b/playgrounds/transforms/transforms.js
index 3b12f65..f9de24b 100644
--- a/playgrounds/transforms/transforms.js
+++ b/playgrounds/transforms/transforms.js
@@ -1,5 +1,5 @@
-let mover = SVG.select("#new")[0]
+// let mover = SVG.select("#new")[0]
// mover.transform({
// // position: [800, 500],
// // origin: [200, 400],
@@ -18,3 +18,18 @@ let mover = SVG.select("#new")[0]
//
//
// var es = SVG.select('ellipse')
+
+draw = SVG("svg")
+
+
+offset = draw.screenCTM()
+draw.viewbox(100,100, 200, 200)
+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)
+
+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")
+
+// rect1.toParent(nested).transform()
+// rect2.toParent(g2).transform()