0 | module Web.Canvas.Transformation
 1 |
 2 | import Data.Linear.Token
 3 | import Web.Canvas.Angle
 4 | import Web.Canvas.Hints
 5 | import Web.Internal.HtmlPrim
 6 |
 7 | parameters {auto ct : CanvasTransform}
 8 |
 9 |   export %inline
10 |   rotate : Angle -> IO1 ()
11 |   rotate a = ffi $ prim__rotate ct a.radians
12 |
13 |   export %inline
14 |   scale : (x,y : Double) -> IO1 ()
15 |   scale x y = ffi $ prim__scale ct x y
16 |
17 |   export %inline
18 |   translate : (x,y : Double) -> IO1 ()
19 |   translate x y = ffi $ prim__translate ct x y
20 |
21 |   export
22 |   transform : (a,b,c,d,e,f : Double) -> IO1 ()
23 |   transform a b c d e f = ffi $ prim__setTransform ct a b c d e f
24 |