diff options
-rw-r--r-- | text.lua | 2 | ||||
-rw-r--r-- | text_tests.lua | 4 |
2 files changed, 3 insertions, 3 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. diff --git a/text_tests.lua b/text_tests.lua index 837fe3a..4de3759 100644 --- a/text_tests.lua +++ b/text_tests.lua @@ -432,9 +432,9 @@ function test_draw_wrapping_text_containing_non_ascii() local y = Editor_state.top App.screen.check(y, 'mad', 'F - test_draw_wrapping_text_containing_non_ascii/screen:1') y = y + Editor_state.line_height - App.screen.check(y, 'am ', 'F - test_draw_wrapping_text_containing_non_ascii/screen:2') + App.screen.check(y, 'am I', 'F - test_draw_wrapping_text_containing_non_ascii/screen:2') y = y + Editor_state.line_height - App.screen.check(y, 'I’m ', 'F - test_draw_wrapping_text_containing_non_ascii/screen:3') + App.screen.check(y, '’m a', 'F - test_draw_wrapping_text_containing_non_ascii/screen:3') end function test_click_on_wrapping_line() |