~jaro/balkon

ref: adba83834db9632c2bc91313529277926a228bae balkon/src/Data/Text/ParagraphLayout/Internal/ParagraphExtents.hs -rw-r--r-- 563 bytes
adba8383Jaro Fix terminology for box layout bounds. 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