Module

Graphics.CanvasAction.Transformation

Package
purescript-canvas-action
Repository
artemisSystem/purescript-canvas-action

#DOMMatrixRecord Source

type DOMMatrixRecord = { a :: Number, b :: Number, c :: Number, d :: Number, e :: Number, f :: Number }

#transform Source

transform :: forall m. MonadCanvasAction m => DOMMatrix -> m Unit

#getTransform Source

getTransform :: forall m. MonadCanvasAction m => m DOMMatrix

Gets the current transformation matrix

#setTransform Source

setTransform :: forall m. MonadCanvasAction m => DOMMatrix -> m Unit

Sets the transformation matrix to the given DOMMatrix

#resetTransform Source

resetTransform :: forall m. MonadCanvasAction m => m Unit

Resets the transformation matrix

#transformedBy Source

transformedBy :: forall m a. MonadCanvasAction m => DOMMatrix -> m a -> m a

Applies the given transformation, runs the given action, and returns the transformation matrix to its previous state.

#transformedTo Source

transformedTo :: forall m a. MonadCanvasAction m => DOMMatrix -> m a -> m a

Sets the transformation matrix to the given DOMMatrix, runs the given action, and returns the transformation matrix to its previous state.

#transformPoint Source

transformPoint :: forall p. AsPosEndo Number p => DOMMatrix -> p -> p

Applies a tranformation matrix to a point

#translate Source

translate :: Number -> Number -> DOMMatrix

Constructs a DOMMatrix that applies a translation

#scale Source

scale :: Number -> Number -> DOMMatrix

Constructs a DOMMatrix that applies a scaling

#rotate Source

rotate :: Radians -> DOMMatrix

Constructs a DOMMatrix that applies a rotation

#rotateAround Source

rotateAround :: forall p. ToPos Number p => p -> Radians -> DOMMatrix

Constructs a DOMMatrix that applies a rotation around the specified point

#skew Source

skew :: Number -> Number -> DOMMatrix

Constructs a DOMMatrix that applies a skewing