LibGUI: Only redraw sliders after the on_change callback has finished

This prevents the seek slider in VideoPlayer from skipping forward and
then back when fast seeking is enabled. Previously, it was possible for
a single frame to render before the actual seek position in the seek
bar was set.
This commit is contained in:
Zaggy1024 2023-04-12 01:59:26 -05:00 committed by Sam Atkins
parent e391f18e9e
commit d4c33a7134
Notes: sideshowbarker 2024-07-17 02:23:25 +09:00

View file

@ -57,10 +57,9 @@ void AbstractSlider::set_value(int value, AllowCallback allow_callback, DoClamp
if (m_value == value)
return;
m_value = value;
update();
if (on_change && allow_callback == AllowCallback::Yes)
on_change(m_value);
update();
}
}