summaryrefslogtreecommitdiff
path: root/scene/2d/shape_cast_2d.cpp
diff options
context:
space:
mode:
authorMicky <micheledevita2@gmail.com>2022-08-13 23:21:24 +0200
committerMicky <micheledevita2@gmail.com>2022-08-29 14:59:47 +0200
commite31bb5ffeb279f704cff1963c2650df7ad3ecdd6 (patch)
treed116cb0fea6dae856d338b63ab310024b5fc479a /scene/2d/shape_cast_2d.cpp
parente60086f98b07365d6174677df84c9a22bfb56d15 (diff)
Rename `CanvasItem.update()` to `queue_redraw()`
Affects a lot of classes. Very thoroughly checked signal connections and deferred calls to this method, add_do_method/add_undo_method calls, and so on. Also renames the internal `_update_callback()` to `_redraw_callback()` for consistency. Just a few comments have also been changed to say "redraw". In CPUParticles2D, there was a private variable with the same name. It has been renamed to `do_redraw`.
Diffstat (limited to 'scene/2d/shape_cast_2d.cpp')
-rw-r--r--scene/2d/shape_cast_2d.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/scene/2d/shape_cast_2d.cpp b/scene/2d/shape_cast_2d.cpp
index 316988d298..a25d5934ee 100644
--- a/scene/2d/shape_cast_2d.cpp
+++ b/scene/2d/shape_cast_2d.cpp
@@ -40,7 +40,7 @@
void ShapeCast2D::set_target_position(const Vector2 &p_point) {
target_position = p_point;
if (is_inside_tree() && (Engine::get_singleton()->is_editor_hint() || get_tree()->is_debugging_collisions_hint())) {
- update();
+ queue_redraw();
}
}
@@ -132,7 +132,7 @@ real_t ShapeCast2D::get_closest_collision_unsafe_fraction() const {
void ShapeCast2D::set_enabled(bool p_enabled) {
enabled = p_enabled;
- update();
+ queue_redraw();
if (is_inside_tree() && !Engine::get_singleton()->is_editor_hint()) {
set_physics_process_internal(p_enabled);
}
@@ -152,7 +152,7 @@ void ShapeCast2D::set_shape(const Ref<Shape2D> &p_shape) {
shape_rid = shape->get_rid();
}
update_configuration_warnings();
- update();
+ queue_redraw();
}
Ref<Shape2D> ShapeCast2D::get_shape() const {
@@ -182,7 +182,7 @@ bool ShapeCast2D::get_exclude_parent_body() const {
}
void ShapeCast2D::_redraw_shape() {
- update();
+ queue_redraw();
}
void ShapeCast2D::_notification(int p_what) {
@@ -325,7 +325,7 @@ void ShapeCast2D::_update_shapecast_state() {
collided = !result.is_empty();
if (prev_collision_state != collided) {
- update();
+ queue_redraw();
}
}