From eb9946862d1540e89d86ec2ffe78ab4962002511 Mon Sep 17 00:00:00 2001 From: Max Rottenkolber Date: Sun, 4 Apr 2021 20:39:58 +0200 Subject: [PATCH] docview: fix rounding bug in get_line_text_y_offset (vertically center text in selection) --- data/core/docview.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/data/core/docview.lua b/data/core/docview.lua index 73191c2..727b8ac 100644 --- a/data/core/docview.lua +++ b/data/core/docview.lua @@ -119,9 +119,8 @@ end function DocView:get_line_text_y_offset() - local lh = self:get_line_height() local th = self:get_font():get_height() - return (lh - th) / 2 + return math.floor(th*config.line_height - th) end