geomancy-layout-0.1: Geometry and matrix manipulation
Safe HaskellSafe-Inferred
LanguageGHC2021

Geomancy.Layout.Alignment

Synopsis

Documentation

type Alignment = Vec2 Source #

leftcenterright & topmiddlebottom

pattern Begin :: Origin Source #

pattern Middle :: Origin Source #

pattern End :: Origin Source #

placeSize1d :: Origin -> Float -> Float -> (Float, Float) Source #

Distribute size difference according to origin.

(before, after) = placeSize1d _origin size target
before + size + after === target

placeBegin = placeSize1d 0
(0.0, 1.0) = placeBegin 1.0 2.0

placeMiddle = placeSize1d 0.5
(1.0, 1.0) = placeMiddle 1.0 3.0

placeEnd = placeSize1d 1.0
(1.0, 0.0) = placeEnd 1.0 2.0