about summary refs log tree commit diff stats
path: root/text.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-07-20 07:15:46 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-07-20 07:15:46 -0700
commit9f4b41d82949adbad9df0c89b3c92d8c3ac43630 (patch)
tree02b945d46a1032e21ecf9238d3197640d5cd0738 /text.lua
parenta472d218f21cc0787a9e52c6cb03819b27a247e9 (diff)
downloadview.love-9f4b41d82949adbad9df0c89b3c92d8c3ac43630.tar.gz
exclude left margin from my word-split heuristic
Gratifying how few tests need changing. Recent commits seem on the right
track.
Diffstat (limited to 'text.lua')
-rw-r--r--text.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/text.lua b/text.lua
index c83a177..39b73d8 100644
--- a/text.lua
+++ b/text.lua
@@ -98,7 +98,7 @@ function Text.compute_fragments(State, line_index)
 --?     print('x: '..tostring(x)..'; '..tostring(State.right-x)..'px to go')
     while x + frag_width > State.right do
 --?       print(('checking whether to split fragment ^%s$ of width %d when rendering from %d'):format(frag, frag_width, x))
-      if x < 0.8*State.right then
+      if (x-State.left) < 0.8 * (State.right-State.left) then
 --?         print('splitting')
         -- long word; chop it at some letter
         -- We're not going to reimplement TeX here.