From b57f7def1fe7edff95be3d0ecb136f30b58d3252 Mon Sep 17 00:00:00 2001 From: Marcus Nilsson Date: Mon, 19 Jul 2021 11:42:53 +0200 Subject: [PATCH] LibGUI: Don't invalidate scrollbar rect if disabled No need to repaint if it's not scrollable, this saves a tiny bit of repaint :) --- Userland/Libraries/LibGUI/Scrollbar.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Userland/Libraries/LibGUI/Scrollbar.cpp b/Userland/Libraries/LibGUI/Scrollbar.cpp index 0b6017510a..f9da67dacb 100644 --- a/Userland/Libraries/LibGUI/Scrollbar.cpp +++ b/Userland/Libraries/LibGUI/Scrollbar.cpp @@ -327,6 +327,9 @@ Scrollbar::Component Scrollbar::component_at_position(const Gfx::IntPoint& posit void Scrollbar::mousemove_event(MouseEvent& event) { + if (!is_scrollable()) + return; + m_last_mouse_position = event.position(); auto old_hovered_component = m_hovered_component;