Module

Gesso.Geometry.Dimensions

Package
purescript-gesso
Repository
smilack/purescript-gesso

A collection of types and functions for specifying sizes and positions.

#Area Source

type Area = Record (Size Number ())

The size of a rectangle.

#Point Source

type Point = Record (Position Number ())

An (x, y) coordinate

#Position Source

type Position :: Type -> Row Type -> Row Typetype Position a r = (x :: a, y :: a | r)

A row representing anything that can have x and y values.

#Rect Source

type Rect = Record (Rectangular Number ())

A rectangle positioned in space.

#Rectangular Source

type Rectangular :: Type -> Row Type -> Row Typetype Rectangular a r = (Position a) + (Size a) + r

A row representing anything that can have x, y, width, and height properties.

#Size Source

type Size :: Type -> Row Type -> Row Typetype Size a r = (height :: a, width :: a | r)

A row representing anything that can have a width and height.

#largestContainedArea Source

largestContainedArea :: forall r1 r2. Record (Size Number r1) -> Record (Size Number r2) -> Area

Given the sizes of an inner and an outer rectangle, find the largest size the inner can be scaled to while still fitting entirely within the outer.

#null Source

null :: Rect

A Rect with no width or height, located at the origin.

#origin Source

origin :: Point

A Point at (0.0, 0.0)

#sizeless Source

sizeless :: Area

An Area with no width or height