diff --git a/Userland/Libraries/LibGUI/Scrollbar.cpp b/Userland/Libraries/LibGUI/Scrollbar.cpp index e1f303b156..f5aed60fc6 100644 --- a/Userland/Libraries/LibGUI/Scrollbar.cpp +++ b/Userland/Libraries/LibGUI/Scrollbar.cpp @@ -232,7 +232,7 @@ void Scrollbar::on_automatic_scrolling_timer_fired() return; } if (m_pressed_component == Component::IncrementButton && component_at_position(m_last_mouse_position) == Component::IncrementButton) { - set_value(value() + step()); + increase_slider_by_steps(1); return; } if (m_pressed_component == Component::Gutter && component_at_position(m_last_mouse_position) == Component::Gutter) { @@ -299,7 +299,7 @@ void Scrollbar::mousewheel_event(MouseEvent& event) { if (!is_scrollable()) return; - set_value(value() + event.wheel_delta() * step()); + increase_slider_by_steps(event.wheel_delta()); Widget::mousewheel_event(event); } diff --git a/Userland/Libraries/LibWeb/InProcessWebView.cpp b/Userland/Libraries/LibWeb/InProcessWebView.cpp index bc26f73fad..9bcc0062f3 100644 --- a/Userland/Libraries/LibWeb/InProcessWebView.cpp +++ b/Userland/Libraries/LibWeb/InProcessWebView.cpp @@ -254,13 +254,13 @@ void InProcessWebView::keydown_event(GUI::KeyEvent& event) vertical_scrollbar().set_value(vertical_scrollbar().max()); break; case Key_Down: - vertical_scrollbar().set_value(vertical_scrollbar().value() + vertical_scrollbar().step()); + vertical_scrollbar().increase_slider_by_steps(1); break; case Key_Up: vertical_scrollbar().set_value(vertical_scrollbar().value() - vertical_scrollbar().step()); break; case Key_Left: - horizontal_scrollbar().set_value(horizontal_scrollbar().value() + horizontal_scrollbar().step()); + horizontal_scrollbar().increase_slider_by_steps(1); break; case Key_Right: horizontal_scrollbar().set_value(horizontal_scrollbar().value() - horizontal_scrollbar().step());