@@ 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