~jaro/balkon

397a9e427f251005c29846c94299ef5d6467d352 — Jaro 11 months ago 41c384a
Fix handling of mixed line height.

Displace lines by the height of the tallest fragment in the previous
line, not the shortest one.
2 files changed, 4 insertions(+), 1 deletions(-)

M CHANGELOG.md
M src/Data/Text/ParagraphLayout/Internal/Layout.hs
M CHANGELOG.md => CHANGELOG.md +3 -0
@@ 2,6 2,9 @@

## 1.2.0.0 -- TBD

* Fixed a bug where only the height of the shortest fragment on a line
  would be considered when positioning the following line.

* Removed `paragraphLineHeight` from the rich text interface
  after it was included by mistake.
  Rich text needs to use `textLineHeight` instead.

M src/Data/Text/ParagraphLayout/Internal/Layout.hs => src/Data/Text/ParagraphLayout/Internal/Layout.hs +1 -1
@@ 103,7 103,7 @@ positionLineH :: Int32 -> (Int, PL.ProtoLine NonEmpty d) ->
    (Int32, NonEmpty (FragmentWithSpan d))
positionLineH originY (num, pl) = (nextY, frags)
    where
        nextY = maximum $ fmap y_min rects
        nextY = minimum $ fmap y_min rects
        rects = fmap (\ (WithSpan _ r) -> fragmentRect r) frags
        (_, frags) = mapAccumL (positionFragmentH num originY) originX wpfs
        wpfs = PL.applyBoxes pl