From 03b6f8e7fd73c391d872004bb77494e89b8cb097 Mon Sep 17 00:00:00 2001 From: thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> Date: Wed, 1 Sep 2021 16:54:12 -0400 Subject: [PATCH] LibGUI: Don't draw Scrollbar scrubber when scrubber rect is null Fixes null scrubbers drawing over the decrement button when window dimensions dictate they disappear. --- Userland/Libraries/LibGUI/Scrollbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGUI/Scrollbar.cpp b/Userland/Libraries/LibGUI/Scrollbar.cpp index c3880c389a..c6867e7d94 100644 --- a/Userland/Libraries/LibGUI/Scrollbar.cpp +++ b/Userland/Libraries/LibGUI/Scrollbar.cpp @@ -197,7 +197,7 @@ void Scrollbar::paint_event(PaintEvent& event) painter.draw_bitmap(increment_location, orientation() == Orientation::Vertical ? *s_down_arrow_bitmap : *s_right_arrow_bitmap, (has_scrubber() && is_enabled()) ? palette().button_text() : palette().threed_shadow1()); } - if (has_scrubber()) + if (has_scrubber() && !scrubber_rect().is_null()) Gfx::StylePainter::paint_button(painter, scrubber_rect(), palette(), Gfx::ButtonStyle::ThickCap, false, hovered_component_for_painting == Component::Scrubber || m_pressed_component == Component::Scrubber); }