summaryrefslogtreecommitdiff
path: root/scene/gui/scroll_container.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/scroll_container.cpp')
-rw-r--r--scene/gui/scroll_container.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp
index e182e491d3..1ad1e3f638 100644
--- a/scene/gui/scroll_container.cpp
+++ b/scene/gui/scroll_container.cpp
@@ -67,7 +67,7 @@ Size2 ScrollContainer::get_minimum_size() const {
};
void ScrollContainer::_cancel_drag() {
- set_fixed_process(false);
+ set_physics_process(false);
drag_touching_deaccel = false;
drag_touching = false;
drag_speed = Vector2();
@@ -121,7 +121,7 @@ void ScrollContainer::_gui_input(const Ref<InputEvent> &p_gui_input) {
if (mb->is_pressed()) {
if (drag_touching) {
- set_fixed_process(false);
+ set_physics_process(false);
drag_touching_deaccel = false;
drag_touching = false;
drag_speed = Vector2();
@@ -139,7 +139,7 @@ void ScrollContainer::_gui_input(const Ref<InputEvent> &p_gui_input) {
drag_touching_deaccel = false;
time_since_motion = 0;
if (drag_touching) {
- set_fixed_process(true);
+ set_physics_process(true);
time_since_motion = 0;
}
}
@@ -150,7 +150,7 @@ void ScrollContainer::_gui_input(const Ref<InputEvent> &p_gui_input) {
if (drag_speed == Vector2()) {
drag_touching_deaccel = false;
drag_touching = false;
- set_fixed_process(false);
+ set_physics_process(false);
} else {
drag_touching_deaccel = true;
@@ -182,7 +182,7 @@ void ScrollContainer::_gui_input(const Ref<InputEvent> &p_gui_input) {
}
}
-void ScrollContainer::_update_scrollbar_pos() {
+void ScrollContainer::_update_scrollbar_position() {
Size2 hmin = h_scroll->get_combined_minimum_size();
Size2 vmin = v_scroll->get_combined_minimum_size();
@@ -205,7 +205,7 @@ void ScrollContainer::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
- call_deferred("_update_scrollbar_pos");
+ call_deferred("_update_scrollbar_position");
};
if (p_what == NOTIFICATION_SORT_CHILDREN) {
@@ -257,14 +257,14 @@ void ScrollContainer::_notification(int p_what) {
update_scrollbars();
}
- if (p_what == NOTIFICATION_FIXED_PROCESS) {
+ if (p_what == NOTIFICATION_PHYSICS_PROCESS) {
if (drag_touching) {
if (drag_touching_deaccel) {
Vector2 pos = Vector2(h_scroll->get_value(), v_scroll->get_value());
- pos += drag_speed * get_fixed_process_delta_time();
+ pos += drag_speed * get_physics_process_delta_time();
bool turnoff_h = false;
bool turnoff_v = false;
@@ -294,7 +294,7 @@ void ScrollContainer::_notification(int p_what) {
float sgn_x = drag_speed.x < 0 ? -1 : 1;
float val_x = Math::abs(drag_speed.x);
- val_x -= 1000 * get_fixed_process_delta_time();
+ val_x -= 1000 * get_physics_process_delta_time();
if (val_x < 0) {
turnoff_h = true;
@@ -302,7 +302,7 @@ void ScrollContainer::_notification(int p_what) {
float sgn_y = drag_speed.y < 0 ? -1 : 1;
float val_y = Math::abs(drag_speed.y);
- val_y -= 1000 * get_fixed_process_delta_time();
+ val_y -= 1000 * get_physics_process_delta_time();
if (val_y < 0) {
turnoff_v = true;
@@ -311,7 +311,7 @@ void ScrollContainer::_notification(int p_what) {
drag_speed = Vector2(sgn_x * val_x, sgn_y * val_y);
if (turnoff_h && turnoff_v) {
- set_fixed_process(false);
+ set_physics_process(false);
drag_touching = false;
drag_touching_deaccel = false;
}
@@ -322,10 +322,10 @@ void ScrollContainer::_notification(int p_what) {
Vector2 diff = drag_accum - last_drag_accum;
last_drag_accum = drag_accum;
- drag_speed = diff / get_fixed_process_delta_time();
+ drag_speed = diff / get_physics_process_delta_time();
}
- time_since_motion += get_fixed_process_delta_time();
+ time_since_motion += get_physics_process_delta_time();
}
}
}
@@ -448,7 +448,7 @@ void ScrollContainer::_bind_methods() {
ClassDB::bind_method(D_METHOD("is_h_scroll_enabled"), &ScrollContainer::is_h_scroll_enabled);
ClassDB::bind_method(D_METHOD("set_enable_v_scroll", "enable"), &ScrollContainer::set_enable_v_scroll);
ClassDB::bind_method(D_METHOD("is_v_scroll_enabled"), &ScrollContainer::is_v_scroll_enabled);
- ClassDB::bind_method(D_METHOD("_update_scrollbar_pos"), &ScrollContainer::_update_scrollbar_pos);
+ ClassDB::bind_method(D_METHOD("_update_scrollbar_position"), &ScrollContainer::_update_scrollbar_position);
ClassDB::bind_method(D_METHOD("set_h_scroll", "val"), &ScrollContainer::set_h_scroll);
ClassDB::bind_method(D_METHOD("get_h_scroll"), &ScrollContainer::get_h_scroll);
ClassDB::bind_method(D_METHOD("set_v_scroll", "val"), &ScrollContainer::set_v_scroll);