pgui: Fix slider thumb entering dragging state on button press

This caused updating the slider while a button is pressed and the mouse is held over the thumb not to work.

Fixes #1188
This commit is contained in:
rdb 2021-10-26 13:45:38 +02:00
parent de334f5597
commit 618e6f3fee

View File

@ -605,8 +605,10 @@ item_press(PGItem *item, const MouseWatcherParameter &param) {
ClockObject::get_global_clock()->get_frame_time() + scroll_initial_delay;
} else if (item == _thumb_button) {
_scroll_button_held = nullptr;
begin_drag();
if (((PGButton *)item)->has_click_button(param.get_button())) {
_scroll_button_held = nullptr;
begin_drag();
}
}
}