@@ 75,16 75,17 @@ lowerSpacing :: (CastDouble m, CastDouble n) => (x -> PaddedBox m n) ->
lowerSpacing cb (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@(_, Left box, _) child opts) = inlineBox e box child opts
- inner' (InlineBox e@(_, Right k, _) (Box childs opts') opts) =
- let box = cb k in inlineBox e box (Box childs opts' {
+ inner' (InlineBox e@(_, Left box, _) child opts) =
+ inlineBox e (leftSpace box') (rightSpace box') child opts
+ where box' = mapX' unscale $ mapY' unscale box
+ inner' (InlineBox e@(_, Right k, _) (Box childs opts') opts) = let box = cb k
+ in inlineBox e (Box.width $ mapX' unscale box) 0 (Box childs opts' {
textAscender = Just $ Box.height $ mapY' unscale box
}) opts
inner' self@(TextSequence _ _) = self
- inlineBox dat f child opts = InlineBox dat (inner child) $
- flip activateBoxSpacing opts $
- BoxSpacingLeftRight (leftSpace box) (rightSpace box)
- where box = mapX' unscale $ mapY' unscale f
+ inlineBox dat left right child opts = InlineBox dat (inner child) $
+ flip activateBoxSpacing opts $ BoxSpacingLeftRight left right
+
-- | A tree extracted from Balkón's inline layout.