mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:57:35 +00:00
LibGUI: Fix crash when clicking on small Scrollbar gutter
When a Scrollbar becomes too small to display a scrubber, clicking on the empty gutter failed the VERIFY. This fixes that oversight.
This commit is contained in:
parent
c2f94b92c4
commit
d1d5602132
1 changed files with 1 additions and 2 deletions
|
@ -206,8 +206,7 @@ void Scrollbar::paint_event(PaintEvent& event)
|
|||
hovered_component_for_painting = Component::None;
|
||||
|
||||
painter.fill_rect_with_dither_pattern(rect(), palette().button().lightened(1.3f), palette().button());
|
||||
if (m_gutter_click_state != GutterClickState::NotPressed && has_scrubber() && hovered_component_for_painting == Component::Gutter) {
|
||||
VERIFY(!scrubber_rect().is_null());
|
||||
if (m_gutter_click_state != GutterClickState::NotPressed && has_scrubber() && !scrubber_rect().is_null() && hovered_component_for_painting == Component::Gutter) {
|
||||
Gfx::IntRect rect_to_fill = rect();
|
||||
if (orientation() == Orientation::Vertical) {
|
||||
if (m_gutter_click_state == GutterClickState::BeforeScrubber) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue