~jaro/balkon

3bea8585455b46090d73ddaacf6defe025bb8e05 — Jaro 1 year, 6 months ago 704f1fc
Qualify Plain pagination.
1 files changed, 3 insertions(+), 2 deletions(-)

M src/Data/Text/ParagraphLayout/Internal/Paginable.hs
M src/Data/Text/ParagraphLayout/Internal/Paginable.hs => src/Data/Text/ParagraphLayout/Internal/Paginable.hs +3 -2
@@ 10,7 10,8 @@ import Data.Int (Int32)

import Data.Text.ParagraphLayout.Internal.LinePagination
import Data.Text.ParagraphLayout.Internal.ParagraphLine
import Data.Text.ParagraphLayout.Internal.Plain.ParagraphLayout
import qualified Data.Text.ParagraphLayout.Internal.Plain.ParagraphLayout
    as Plain

-- | Defines options for breaking a layout into pages.
data PageOptions = PageOptions


@@ 75,7 76,7 @@ instance Line a => Paginable [a] where

-- | Implementation of paginating a plain text paragraph layout.
-- Breaks the layout on page boundaries and automatically adjusts coordinates.
instance Paginable (ParagraphLayout d) where
instance Paginable (Plain.ParagraphLayout d) where
    paginate opts pl = case paginate opts (cutLines pl) of
        (c, p, Nothing) -> (c, mergeLines p, Nothing)
        (c, p, Just rest) -> (c, mergeLines p, Just (mergeLines rest))