This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.

Composer.Geometry.Rect

A 2D rectangle defined by a point and a size.

type alias Rect = { origin : Point , size : Size }
atOrigin : Size -> Rect

A rectangle laying on the origin of coordinates (0, 0).

module Composer.Geometry.Rect
    exposing
        ( Rect
        , atOrigin
        )

{-| A 2D rectangle defined by a point and a size.

@docs Rect , atOrigin

-}

import Composer.Geometry.Point as Point exposing (Point)
import Composer.Geometry.Size exposing (Size)


{-| -}
type alias Rect =
    { origin : Point
    , size : Size
    }


{-| A rectangle laying on the origin of coordinates (0, 0).
-}
atOrigin : Size -> Rect
atOrigin size =
    { origin = Point.origin
    , size = size
    }