Sfoglia il codice sorgente

Fixed scrollbar jitter when clicking

Paulb23 8 anni fa
parent
commit
5815aaa035
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      scene/gui/scroll_bar.cpp

+ 1 - 1
scene/gui/scroll_bar.cpp

@@ -343,7 +343,7 @@ void ScrollBar::_notification(int p_what) {
 				double dist = sqrt(target * target);
 				double vel = ((target / dist) * 500) * get_fixed_process_delta_time();
 
-				if (vel >= dist) {
+				if (Math::abs(vel) >= dist) {
 					set_value(target_scroll);
 				} else {
 					set_value(get_value() + vel);