Browse Source

LibGUI: Don't invalidate scrollbar rect if disabled

No need to repaint if it's not scrollable, this saves a tiny bit of
repaint :)
Marcus Nilsson 4 năm trước cách đây
mục cha
commit
b57f7def1f
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      Userland/Libraries/LibGUI/Scrollbar.cpp

+ 3 - 0
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;