1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 08:07:45 +00:00

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.
This commit is contained in:
thankyouverycool 2021-09-01 16:54:12 -04:00 committed by Linus Groh
parent 93e45588e5
commit 03b6f8e7fd

View file

@ -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);
}