Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- type Alignment = Vec2
- leftTop :: Alignment
- leftMiddle :: Alignment
- leftBottom :: Alignment
- centerTop :: Alignment
- center :: Alignment
- centerBottom :: Alignment
- rightTop :: Alignment
- rightMiddle :: Alignment
- rightBottom :: Alignment
- type Origin = Float
- pattern Begin :: Origin
- pattern Middle :: Origin
- pattern End :: Origin
- placeSize1d :: Origin -> Float -> Float -> (Float, Float)
Documentation
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