~jaro/balkon

ref: 85a32d42819fa08632855b2106af255f2e52e3fa balkon/src/Data/Text/ParagraphLayout/Internal/ParagraphAlignment.hs -rw-r--r-- 1.1 KiB
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
27
28
29
30
31
32
module Data.Text.ParagraphLayout.Internal.ParagraphAlignment
    ( ParagraphAlignment (..)
    )
where

-- | Determines how the contents of the paragraph should be aligned
-- horizontally, that is, how should fragments be stacked inside each line
-- when there is space available.
--
-- This has no effect on lines with overflowing content.
data ParagraphAlignment

    = AlignLeft
    -- ^ Stack fragments to the left edge of each line,
    -- leaving free space on the right side.
    --
    -- The leftmost fragment on each non-overflowing line will have its
    -- `Data.Text.ParagraphLayout.Rect.x_min` equal to @0@.

    | AlignRight
    -- ^ Stack fragments to the right edge of each line,
    -- leaving free space on the left side.
    --
    -- The rightmost fragment on each non-overflowing line will have its
    -- `Data.Text.ParagraphLayout.Rect.x_max` equal to
    -- `Data.Text.ParagraphLayout.Rich.paragraphMaxWidth`.

    | AlignCentreH
    -- ^ Stack fragments to the horizontal centre of each line,
    -- leaving free space split evenly between each side.

    deriving (Eq, Read, Show)