From 202e42b568a50547e3c1b32f6eed41ad6ad071a3 Mon Sep 17 00:00:00 2001 From: Guldoman Date: Tue, 12 Apr 2022 02:37:21 +0200 Subject: [PATCH] Avoid calling `View:scrollbar_overlaps_point` uselessly `View:on_mouse_moved` already updated `self.hovered_scrollbar`, so use that instead. --- data/core/docview.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/core/docview.lua b/data/core/docview.lua index 397b455e..a3f9ebd2 100644 --- a/data/core/docview.lua +++ b/data/core/docview.lua @@ -227,7 +227,7 @@ end function DocView:on_mouse_moved(x, y, ...) DocView.super.on_mouse_moved(self, x, y, ...) - if self:scrollbar_overlaps_point(x, y) or self.dragging_scrollbar then + if self.hovered_scrollbar or self.dragging_scrollbar then self.cursor = "arrow" else self.cursor = "ibeam"