~jaro/balkon

ref: 85a32d42819fa08632855b2106af255f2e52e3fa balkon/src/Data/Text/ParagraphLayout/Internal/ParagraphExtents.hs -rw-r--r-- 563 bytes
85a32d42Jaro Add centre/right paragraph alignment. 1 year, 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
module Data.Text.ParagraphLayout.Internal.ParagraphExtents
    ( paragraphOriginX
    , paragraphOriginY
    , containRects
    , emptyRect
    )
where

import Data.Text.ParagraphLayout.Internal.Rect

paragraphOriginX :: (Num a) => a
paragraphOriginX = 0

paragraphOriginY :: (Num a) => a
paragraphOriginY = 0

emptyRect :: (Num a) => Rect a
emptyRect = Rect
    { x_origin = paragraphOriginX
    , y_origin = paragraphOriginY
    , x_size = 0
    , y_size = 0
    }

containRects :: (Ord a, Num a) => [Rect a] -> Rect a
containRects = foldr (union LH) emptyRect