on master help sign in
Add scaleX and scaleY
commita654bfa96b965638148a0bb7e239286a263c5c00 authorMichael Sondergaard <msond@cs.au.dk> dateMon 21 Oct 2013, 15:02 (13 years ago) parentf0b38ae
1 file changed+8
libraries/Transform2D.elm+8
libraries/Transform2D.elm+8
@@ -49,6 +49,14 @@ rotation = Native.Transform2D.rotation
4949translation : Float -> Float -> Transform2D
5050translation = Native.Transform2D.translation
5151
52+{-| Creates a transformation for horizontal scaling -}
53+scaleX : Float -> Transform2D
54+scaleX x = matrix x 0 0 1 0 0
55+
56+{-| Creates a transformation for vertical scaling -}
57+scaleY : Float -> Transform2D
58+scaleY y = matrix y 0 0 1 0 0
59+
5260{-| Multiplies two transforms together:
5361
5462 multiply a b