From f7e9b3f425a0d1e8f57ff07065e0ca14b113ecfa Mon Sep 17 00:00:00 2001 From: Adrian Cochrane Date: Sun, 2 Jul 2023 14:58:02 +1200 Subject: [PATCH] Fix Balkon's behaviour regarding lack of additional whitespace. --- Graphics/Layout/Inline.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Graphics/Layout/Inline.hs b/Graphics/Layout/Inline.hs index 907a188..15a1e1e 100644 --- a/Graphics/Layout/Inline.hs +++ b/Graphics/Layout/Inline.hs @@ -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 -- 2.30.2