Skip to content

Commit

Permalink
Stop drawing text past the DocView edge in DocView:draw_line_text
Browse files Browse the repository at this point in the history
  • Loading branch information
Guldoman committed Jan 19, 2023
1 parent 7dae15d commit 35b72f5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions data/core/docview.lua
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ function DocView:draw_line_text(line, x, y)
-- do not render newline, fixes issue #1164
if tidx == last_token then text = text:sub(1, -2) end
tx = renderer.draw_text(font, text, tx, ty, color)
if tx > self.position.x + self.size.x then break end
end
return self:get_line_height()
end
Expand Down

0 comments on commit 35b72f5

Please sign in to comment.