Merge pull request #289 from guzba/master

fix multi-break long words
This commit is contained in:
treeform 2021-09-12 13:59:27 -07:00 committed by GitHub
commit c81c336f55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 2 additions and 1 deletions

View file

@ -272,6 +272,7 @@ proc typeset*(
result.selectionRects[i].xy = vec2(at.x, at.y)
at.x += advance(font, result.runes, i)
dec lineStart
prevCanWrap = 0
result.lines[^1][1] = lineStart - 1
result.lines.add((lineStart, 0))

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View file

@ -194,7 +194,7 @@ block:
image.fillText(
font,
"Long words: Supercalifragilisticexpialidocious\nAntidisestablishmentarianism",
bounds = vec2(100, 100)
bounds = vec2(100, 0)
)
doDiff(image, "basic8b")