From 618e6f3feea3abc6edb382cc12ac3a9278b25af8 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 26 Oct 2021 13:45:38 +0200 Subject: [PATCH] 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 --- panda/src/pgui/pgSliderBar.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/panda/src/pgui/pgSliderBar.cxx b/panda/src/pgui/pgSliderBar.cxx index e666d2a496..d423549ccb 100644 --- a/panda/src/pgui/pgSliderBar.cxx +++ b/panda/src/pgui/pgSliderBar.cxx @@ -605,8 +605,10 @@ item_press(PGItem *item, const MouseWatcherParameter ¶m) { 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(); + } } }