@@ -3,15 +3,10 @@ module Graphics.Collage where
4import Either
4import Either
5import Graphics.LineStyle as LS
5import Graphics.LineStyle as LS
6−import Geometry
6+import Graphics.Geometry
7+import Graphics.Matrix as Matrix
12− | Transform Float Float Float Float Float Float
14−type Form = { transforms : [Transform], form : BasicForm }
9+type Form = { transform : Matrix, form : BasicForm }
16data FillStyle
11data FillStyle
@@ -45,20 +40,20 @@ toForm e = Form [] (FElement e)
46group fs = Form [] (FGroup fs)
41group fs = Form [] (FGroup fs)
48−add t f = { transforms = t :: f.transforms, form = f.form }
43+add t f = { transforms = Matrix.multiply t f.transforms, form = f.form }
50radians t = t
45radians t = t
51degrees dep = pi * deg / 180
46degrees dep = pi * deg / 180
52rotations rot = 2 * pi * rot
47rotations rot = 2 * pi * rot
54−rotate t = add (Rotate t)
49+rotate t = add (Matrix.rotate t)
56−scale s = add (Scale s s)
51+scale s = add (Matrix.scale s s)
57−scaleX s = add (Scale s 1)
52+scaleX s = add (Matrix.scale s 1)
58−scaleY s = add (Scale 1 s)
53+scaleY s = add (Matrix.scale 1 s)
60−move x y = add (Move x y)
55+move x y = add (Matrix.translate x y)
61−moveX x = add (Move x 0)
56+moveX x = add (Matrix.translate x 0)
62−moveY y = add (Move 0 y)
57+moveY y = add (Matrix.translate 0 y)
64−transform a b c d e f = add (Transform a b c d e f)
59+transform a b c d e f = add (Matrix.matrix a b c d e f)