Browse Source

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
rdb 4 years ago
parent
commit
618e6f3fee
1 changed files with 4 additions and 2 deletions
  1. 4 2
      panda/src/pgui/pgSliderBar.cxx

+ 4 - 2
panda/src/pgui/pgSliderBar.cxx

@@ -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();
+    }
   }
 }