~alcinnz/CatTrap

9efd1bac720212dcbf7b02b1e6039f6784f52b8b — Adrian Cochrane 1 year, 8 months ago 013c14e
Fix inlines getting prematurely cut off.
1 files changed, 3 insertions(+), 1 deletions(-)

M Graphics/Layout/CSS.hs
M Graphics/Layout/CSS.hs => Graphics/Layout/CSS.hs +3 -1
@@ 202,10 202,12 @@ finalizeChilds root parent (StyleTree { style = CSSBox { display = None } }:chil
finalizeChilds root parent childs@(child:childs')
    | isInlineTree childs, Just self <- finalizeParagraph (flattenTree childs) parent =
        -- FIXME propagate display properties, how to handle the hierarchy.
        -- NOTE: Playing around in firefox, it appears the CSS borders should cover
        -- their entire span, doubling up on borders where needed.
        [LayoutInline temp parent self (repeat temp)]
    | (inlines@(_:_), blocks) <- spanInlines childs,
        Just self <- finalizeParagraph (flattenTree inlines) parent  =
            LayoutInline temp parent self [] : finalizeChilds root parent blocks
            LayoutInline temp parent self (repeat temp) : finalizeChilds root parent blocks
    | (StyleTree { style = CSSBox { display = Inline } }:childs') <- childs =
        finalizeChilds root parent childs' -- Inline's all whitespace...
    | otherwise = finalizeCSS root parent child : finalizeChilds root parent childs'