From ebc78569d9a4d332ebb86748c1e8e86b50a33ad3 Mon Sep 17 00:00:00 2001 From: Adrian Cochrane Date: Fri, 30 Jun 2023 13:32:16 +1200 Subject: [PATCH] Upgrade underlying Balkon. --- Graphics/Layout/CSS.hs | 7 ++----- Graphics/Layout/Inline.hs | 4 ++-- cattrap.cabal | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Graphics/Layout/CSS.hs b/Graphics/Layout/CSS.hs index 357b954..6ed7919 100644 --- a/Graphics/Layout/CSS.hs +++ b/Graphics/Layout/CSS.hs @@ -9,7 +9,7 @@ module Graphics.Layout.CSS(CSSBox(..), BoxSizing(..), Display(..), import qualified Data.Text as Txt import Stylist (PropertyParser(..)) import Stylist.Tree (StyleTree(..)) -import Data.Text.ParagraphLayout.Rich (paragraphLineHeight, constructParagraph, +import Data.Text.ParagraphLayout.Rich (constructParagraph, defaultParagraphOptions, defaultBoxOptions, LineHeight(..), InnerNode(..), Box(..), RootNode(..)) @@ -109,10 +109,7 @@ finalizeChilds root parent style' childs@(child:childs') finalizeParagraph (RootBox (Box [TextSequence _ txt] _)) | Txt.all isSpace txt = Nothing -- Discard isolated whitespace. finalizeParagraph tree = - Just $ constructParagraph "" tree "" defaultParagraphOptions { - paragraphLineHeight = Absolute $ toEnum $ fromEnum - (lineheight parent * hbUnit) - } + Just $ constructParagraph "" tree "" defaultParagraphOptions enumerate = zip $ enumFrom 0 finalizeChilds _ _ _ [] = [] diff --git a/Graphics/Layout/Inline.hs b/Graphics/Layout/Inline.hs index 283fbfb..907a188 100644 --- a/Graphics/Layout/Inline.hs +++ b/Graphics/Layout/Inline.hs @@ -179,8 +179,8 @@ positionTree (x, y) self@(Branch (AncestorBox (a, b, c) d e f g) childs) = where pos = (x + hbScale (x_min rect), y + hbScale (y_min rect)) rect = treeRect self -positionTree (x, y) self@(Leaf (Fragment (a, b, c) d _ f g h)) = - Leaf (Fragment (a, b, (pos, c)) d [] f g h) +positionTree (x, y) self@(Leaf (Fragment (a, b, c) d _ f g h i)) = + Leaf (Fragment (a, b, (pos, c)) d [] f g h i) where pos = (x + hbScale (x_min rect), y + hbScale (y_min rect)) rect = treeRect self diff --git a/cattrap.cabal b/cattrap.cabal index e146c56..33ea32d 100644 --- a/cattrap.cabal +++ b/cattrap.cabal @@ -34,7 +34,7 @@ library stylist-traits >= 0.1.3.0 && < 1, fontconfig-pure >= 0.2 && < 0.3, harfbuzz-pure >= 1.0.3.2 && < 1.1, bytestring, - balkon >= 1.1 && <2, unordered-containers + balkon >= 1.2 && <2, unordered-containers -- hs-source-dirs: default-language: Haskell2010 ghc-options: -Wincomplete-patterns -- 2.30.2