~alcinnz/CatTrap

f7e9b3f425a0d1e8f57ff07065e0ca14b113ecfa — Adrian Cochrane 1 year, 2 months ago ebc7856
Fix Balkon's behaviour regarding lack of additional whitespace.
1 files changed, 5 insertions(+), 4 deletions(-)

M Graphics/Layout/Inline.hs
M Graphics/Layout/Inline.hs => Graphics/Layout/Inline.hs +5 -4
@@ 8,7 8,8 @@ module Graphics.Layout.Inline(paragraphMap, layoutMap, treeMap,
import Data.Text.ParagraphLayout.Rich (Paragraph(..), ParagraphOptions(..),
                                Fragment(..), ParagraphLayout(..), AncestorBox(..),
                                InnerNode(..), Box(..), RootNode(..),
                                layoutRich, boxSpacing, BoxSpacing(..))
                                layoutRich, boxSpacing, BoxSpacing(..),
                                activateBoxSpacing)
import Data.Text.ParagraphLayout.Rect (Rect(..),
                                width, height, x_max, x_min, y_min, y_max)
import Data.Int (Int32)


@@ 63,9 64,9 @@ lowerSpacing :: (CastDouble m, CastDouble n) =>
lowerSpacing (Paragraph a b (RootBox c) d) = Paragraph a b (RootBox $ inner c) d
  where
    inner (Box childs opts) = flip Box opts $ map inner' childs
    inner' (InlineBox e@(_, f, _) child opts) = InlineBox e (inner child) opts {
            boxSpacing = BoxSpacingLeftRight (leftSpace box) (rightSpace box)
        }
    inner' (InlineBox e@(_, f, _) child opts) = InlineBox e (inner child) $
        flip activateBoxSpacing opts $
            BoxSpacingLeftRight (leftSpace box) (rightSpace box)
      where box = mapX' unscale $ mapY' unscale f
    inner' self@(TextSequence _ _) = self