mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:57:44 +00:00
MouseDemo: Restart timer when scrolling to avoid blinking indicator
When scrolling, a timer is triggered to hide the indicator cross. When we continuously scroll, the indicator cross would then blink once the timer kicks in. Instead, let's cancel the current timer and schedule a new one, making the indicator visually smooth.
This commit is contained in:
parent
2c142e4c57
commit
3cf81f1930
1 changed files with 3 additions and 2 deletions
|
@ -143,8 +143,9 @@ public:
|
|||
m_wheel_delta_acc = (m_wheel_delta_acc + event.wheel_delta_y() + 36) % 36;
|
||||
m_show_scroll_wheel = true;
|
||||
update();
|
||||
if (!has_timer())
|
||||
start_timer(500);
|
||||
if (has_timer())
|
||||
stop_timer();
|
||||
start_timer(500);
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue