Graphics.CanvasAction.Transformation
- Package
- purescript-canvas-action
- Repository
- 3ddyy/purescript-canvas-action
This module defines a free monad for working with canvas transformations in
a more pleasant way. Construct transforms with the various functions, like
translate, scale and fullMatrix. There are also alternate functions
(denoted by a '), which take the dedicated data type for that transform,
instead of Numbers, as arguments. Perform a transform with
runTransform, or use transformed to also reset the transformation
matrix to its previous value afterwards.
#TransformationM Source
type TransformationM = Free TransformationF#Transformation Source
type Transformation = TransformationM Unit#translate Source
translate :: Number -> Number -> TransformationConstruct a Transformation from two Numbers representing translation
#translate' Source
translate' :: TranslateTransform -> TransformationConstruct a Transformation from a TranslateTransform
#scale Source
scale :: Number -> Number -> TransformationConstruct a Transformation from two Numbers representing scaling
#scale' Source
scale' :: ScaleTransform -> TransformationConstruct a Transformation from a ScaleTransform
#skew Source
skew :: Number -> Number -> TransformationConstruct a Transformation from two Numbers representing skew
#skew' Source
skew' :: SkewTransform -> TransformationConstruct a Transformation from a SkewTransform
#rotate Source
rotate :: Number -> TransformationConstruct a Transformation from a Number representing radians rotated
#fullMatrix Source
fullMatrix :: Number -> Number -> Number -> Number -> Number -> Number -> TransformationConstruct a Transformation from six Numbers representing a full
matrix transformation
#fullMatrix' Source
fullMatrix' :: FullMatrixTransform -> TransformationConstruct a Transformation from a FullMatrixTransform
#runTransform Source
runTransform :: TransformationM ~> CanvasActionMRun a transformation
#transformed Source
transformed :: forall a. Transformation -> CanvasActionM a -> CanvasActionM aRun a transformation on a CanvasActionM, transforming back afterwards