~jaro/balkon

ref: 81d758baf4c7f7ab803edccb4dd1bb7e82a4753d balkon/src/Data/Text/ParagraphLayout/Internal/ParagraphExtents.hs -rw-r--r-- 563 bytes
81d758baJaro Test handling of empty lines. 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