Explorar o código

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 %!s(int64=4) %!d(string=hai) anos
pai
achega
b57f7def1f
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  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;