~jaro/balkon

ref: 3e3fef4440b5d982144bdb4b13a3d784ba686233 balkon/src/Data/Text/ParagraphLayout/Internal/ParagraphAlignment.hs -rw-r--r-- 1.4 KiB
3e3fef44Jaro Add content rect to Fragment. 1 year, 2 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
33
34
35
36
37
38
39
40
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

    = AlignStart
    -- ^ Behave like `AlignLeft` when the base direction of the paragraph
    -- is LTR, and like `AlignRight` when the base direction is RTL.

    | AlignEnd
    -- ^ Behave like `AlignLeft` when the base direction of the paragraph
    -- is RTL, and like `AlignRight` when the base direction is LTR.

    | 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)