summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorMarkus Sauermann <6299227+Sauermann@users.noreply.github.com>2022-03-27 11:17:36 +0200
committerMarkus Sauermann <6299227+Sauermann@users.noreply.github.com>2022-03-27 14:12:01 +0200
commit0494e024d8cf244f82f8f4b4318f8558375f99ff (patch)
treee314e1d675662ba8d843023215c80e5a8ce485dc /scene
parentf0407ad14de5e8c4c668ba4e6a983d2211022d9a (diff)
Rename warp mouse functions to warp_mouse
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/control.cpp6
-rw-r--r--scene/gui/control.h2
-rw-r--r--scene/main/viewport.cpp8
-rw-r--r--scene/main/viewport.h2
4 files changed, 9 insertions, 9 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index d2d1b5e9b7..ee35eee35d 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -2937,9 +2937,9 @@ Control::MouseFilter Control::get_mouse_filter() const {
return data.mouse_filter;
}
-void Control::warp_mouse(const Point2 &p_to_pos) {
+void Control::warp_mouse(const Point2 &p_position) {
ERR_FAIL_COND(!is_inside_tree());
- get_viewport()->warp_mouse(get_global_transform().xform(p_to_pos));
+ get_viewport()->warp_mouse(get_global_transform().xform(p_position));
}
bool Control::is_text_field() const {
@@ -3331,7 +3331,7 @@ void Control::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_drag_preview", "control"), &Control::set_drag_preview);
ClassDB::bind_method(D_METHOD("is_drag_successful"), &Control::is_drag_successful);
- ClassDB::bind_method(D_METHOD("warp_mouse", "to_position"), &Control::warp_mouse);
+ ClassDB::bind_method(D_METHOD("warp_mouse", "position"), &Control::warp_mouse);
ClassDB::bind_method(D_METHOD("update_minimum_size"), &Control::update_minimum_size);
diff --git a/scene/gui/control.h b/scene/gui/control.h
index becb50a118..9f78d003ae 100644
--- a/scene/gui/control.h
+++ b/scene/gui/control.h
@@ -548,7 +548,7 @@ public:
void grab_click_focus();
- void warp_mouse(const Point2 &p_to_pos);
+ void warp_mouse(const Point2 &p_position);
virtual bool is_text_field() const;
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index ec33e5752e..d2262ff614 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -1124,9 +1124,9 @@ Vector2 Viewport::get_mouse_position() const {
return gui.last_mouse_pos;
}
-void Viewport::warp_mouse(const Vector2 &p_pos) {
- Vector2 gpos = (get_final_transform().affine_inverse() * _get_input_pre_xform()).affine_inverse().xform(p_pos);
- Input::get_singleton()->warp_mouse_position(gpos);
+void Viewport::warp_mouse(const Vector2 &p_position) {
+ Vector2 gpos = (get_final_transform().affine_inverse() * _get_input_pre_xform()).affine_inverse().xform(p_position);
+ Input::get_singleton()->warp_mouse(gpos);
}
void Viewport::_gui_sort_roots() {
@@ -3614,7 +3614,7 @@ void Viewport::_bind_methods() {
ClassDB::bind_method(D_METHOD("is_audio_listener_2d"), &Viewport::is_audio_listener_2d);
ClassDB::bind_method(D_METHOD("get_mouse_position"), &Viewport::get_mouse_position);
- ClassDB::bind_method(D_METHOD("warp_mouse", "to_position"), &Viewport::warp_mouse);
+ ClassDB::bind_method(D_METHOD("warp_mouse", "position"), &Viewport::warp_mouse);
ClassDB::bind_method(D_METHOD("gui_get_drag_data"), &Viewport::gui_get_drag_data);
ClassDB::bind_method(D_METHOD("gui_is_dragging"), &Viewport::gui_is_dragging);
diff --git a/scene/main/viewport.h b/scene/main/viewport.h
index e4912f31c5..d5fca1b881 100644
--- a/scene/main/viewport.h
+++ b/scene/main/viewport.h
@@ -547,7 +547,7 @@ public:
bool is_input_disabled() const;
Vector2 get_mouse_position() const;
- void warp_mouse(const Vector2 &p_pos);
+ void warp_mouse(const Vector2 &p_position);
void set_physics_object_picking(bool p_enable);
bool get_physics_object_picking();