summaryrefslogtreecommitdiffstats
path: root/scene/gui/gradient_edit.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/gui/gradient_edit.cpp
parente60086f98b07365d6174677df84c9a22bfb56d15 (diff)
downloadredot-engine-e31bb5ffeb279f704cff1963c2650df7ad3ecdd6.tar.gz
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/gui/gradient_edit.cpp')
-rw-r--r--scene/gui/gradient_edit.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/scene/gui/gradient_edit.cpp b/scene/gui/gradient_edit.cpp
index cc27a6b7c2..5e56be7c29 100644
--- a/scene/gui/gradient_edit.cpp
+++ b/scene/gui/gradient_edit.cpp
@@ -92,7 +92,7 @@ void GradientEdit::gui_input(const Ref<InputEvent> &p_event) {
points.remove_at(grabbed);
grabbed = -1;
grabbing = false;
- update();
+ queue_redraw();
emit_signal(SNAME("ramp_changed"));
accept_event();
}
@@ -112,7 +112,7 @@ void GradientEdit::gui_input(const Ref<InputEvent> &p_event) {
points.remove_at(grabbed);
grabbed = -1;
grabbing = false;
- update();
+ queue_redraw();
emit_signal(SNAME("ramp_changed"));
accept_event();
}
@@ -138,13 +138,13 @@ void GradientEdit::gui_input(const Ref<InputEvent> &p_event) {
}
emit_signal(SNAME("ramp_changed"));
- update();
+ queue_redraw();
}
}
// Select.
if (mb.is_valid() && mb->get_button_index() == MouseButton::LEFT && mb->is_pressed()) {
- update();
+ queue_redraw();
int x = mb->get_position().x;
int total_w = get_size().width - get_size().height - draw_spacing;
@@ -214,7 +214,7 @@ void GradientEdit::gui_input(const Ref<InputEvent> &p_event) {
grabbing = false;
emit_signal(SNAME("ramp_changed"));
}
- update();
+ queue_redraw();
}
Ref<InputEventMouseMotion> mm = p_event;
@@ -282,7 +282,7 @@ void GradientEdit::gui_input(const Ref<InputEvent> &p_event) {
emit_signal(SNAME("ramp_changed"));
- update();
+ queue_redraw();
}
}
@@ -378,7 +378,7 @@ void GradientEdit::_color_changed(const Color &p_color) {
return;
}
points.write[grabbed].color = p_color;
- update();
+ queue_redraw();
emit_signal(SNAME("ramp_changed"));
}
@@ -393,7 +393,7 @@ void GradientEdit::set_ramp(const Vector<float> &p_offsets, const Vector<Color>
}
points.sort();
- update();
+ queue_redraw();
}
Vector<float> GradientEdit::get_offsets() const {