Module

Gesso.Geometry.Internal

Package
purescript-gesso
Repository
smilack/purescript-gesso

#Scalers Source

type Scalers = { canvas :: Scaler, drawing :: Scaler, scale :: Number }

Data and functions for converting between the coordinate systems of the canvas element on the page and the view box of the application/drawing.

scale is the amount that the view box has been scaled up or down to fit within the canvas element.

canvas and drawing contain the dimensions of the named space and functions for converting coordinates to itself.

#mkScalers Source

mkScalers :: Rect -> Rect -> Scalers

Create a Scalers record based on the view box of the application and the client rect (Gesso.Canvas.Element.getCanvasClientRect, MDN: DOMRect) of the canvas.