~jaro/balkon

ref: ca37c6e309c0e50ea21dbc823c34b4f21c38c977 balkon/src/Data/Text/ParagraphLayout/Internal/ParagraphAlignment.hs -rw-r--r-- 1.4 KiB
ca37c6e3Jaro Fix internal link to non-existent identifier. 1 year, 4 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)