~alcinnz/CatTrap

a2a429363faa68f3cb28a19979cba720e2614c80 — Adrian Cochrane 1 year, 7 months ago 6fb750e
Merge in-porgress changes.
1 files changed, 4 insertions(+), 4 deletions(-)

M Graphics/Layout.hs
M Graphics/Layout.hs => Graphics/Layout.hs +4 -4
@@ 5,7 5,7 @@ module Graphics.Layout(LayoutItem(..),
        boxNatHeight, boxMinHeight, boxMaxHeight, boxHeight,
        boxSplit, boxPaginate, boxPosition, boxLayout, glyphsPerFont) where

import Data.Text.ParagraphLayout (Paragraph(..), ParagraphOptions(..), Fragment(..))
import Data.Text.ParagraphLayout (Paragraph(..), ParagraphOptions(..), PageOptions(..), Fragment(..))

import Graphics.Layout.Box as B
import Graphics.Layout.Grid as G


@@ 24,7 24,7 @@ import Graphics.Text.Font.Choose (Pattern)
data LayoutItem m n x =
    LayoutFlow x (PaddedBox m n) [LayoutItem m n x]
    | LayoutGrid x (Grid m n) [(GridItem m n, LayoutItem m n x)]
    | LayoutInline x Font' Paragraph [x] -- Balkon holds children.
    | LayoutInline x Font' Paragraph PageOptions [x] -- Balkon holds children.
    | LayoutSpan x Font' Fragment
-- More to come...



@@ 45,11 45,11 @@ layoutGetBox (LayoutSpan _ f self) = zero {
layoutGetChilds (LayoutFlow _ _ ret) = ret
layoutGetChilds (LayoutGrid _ _ ret) = map snd ret
layoutGetChilds (LayoutSpan _ _ _) = []
layoutGetChilds (LayoutInline _ font self vals) = map inner $ inlineChildren vals self
layoutGetChilds (LayoutInline _ font self _ vals) = map inner $ inlineChildren vals self
  where inner (val, fragment) = LayoutSpan val font fragment
layoutGetInner (LayoutFlow ret _ _) = ret
layoutGetInner (LayoutGrid ret _ _) = ret
layoutGetInner (LayoutInline ret _ _ _) = ret
layoutGetInner (LayoutInline ret _ _ _ _) = ret
layoutGetInner (LayoutSpan ret _ _) = ret

setCellBox' (child, cell) = cell { gridItemBox = layoutGetBox child }