summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-11-17 11:57:00 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-11-17 11:57:00 +0100
commitef22b6f75734603ac4ae9e615a1716d53366242d (patch)
tree2f5dcfa00a725cd913dbec6cd9cfcb3df30bea09
parent74590e9597b670a63cc90e38ea0403e0c7ae2f1f (diff)
parentcb4bdc7e1b07f308a41454fe06e50c516ce15e32 (diff)
Merge pull request #68766 from TokageItLab/fix-update-animation-fps-edit
Fix GUI update timing when AnimationEditor changes FPS
-rw-r--r--editor/animation_track_editor.cpp5
-rw-r--r--editor/animation_track_editor.h2
2 files changed, 5 insertions, 2 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index 0c8176a44b..9b9b176e82 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -1678,6 +1678,7 @@ void AnimationTimelineEdit::_notification(int p_what) {
}
draw_line(Vector2(0, get_size().height), get_size(), linecolor, Math::round(EDSCALE));
+ update_values();
} break;
}
}
@@ -1700,7 +1701,6 @@ void AnimationTimelineEdit::set_animation(const Ref<Animation> &p_animation, boo
play_position->hide();
}
queue_redraw();
- update_values();
}
Size2 AnimationTimelineEdit::get_minimum_size() const {
@@ -1749,6 +1749,7 @@ void AnimationTimelineEdit::update_values() {
length->set_step(1);
length->set_tooltip_text(TTR("Animation length (frames)"));
time_icon->set_tooltip_text(TTR("Animation length (frames)"));
+ track_edit->editor->_update_key_edit();
} else {
length->set_value(animation->get_length());
length->set_step(0.001);
@@ -1893,7 +1894,6 @@ void AnimationTimelineEdit::_zoom_callback(Vector2 p_scroll_vec, Vector2 p_origi
void AnimationTimelineEdit::set_use_fps(bool p_use_fps) {
use_fps = p_use_fps;
- update_values();
queue_redraw();
}
@@ -4793,6 +4793,7 @@ void AnimationTrackEditor::_update_step(double p_new_step) {
if (step_value != 0.0) {
step_value = 1.0 / step_value;
}
+ timeline->queue_redraw();
}
undo_redo->add_do_method(animation.ptr(), "set_step", step_value);
undo_redo->add_undo_method(animation.ptr(), "set_step", animation->get_step());
diff --git a/editor/animation_track_editor.h b/editor/animation_track_editor.h
index 5c51921d93..01ff943409 100644
--- a/editor/animation_track_editor.h
+++ b/editor/animation_track_editor.h
@@ -135,6 +135,7 @@ class AnimationTrackEditor;
class AnimationTrackEdit : public Control {
GDCLASS(AnimationTrackEdit, Control);
+ friend class AnimationTimelineEdit;
enum {
MENU_CALL_MODE_CONTINUOUS,
@@ -293,6 +294,7 @@ public:
class AnimationTrackEditor : public VBoxContainer {
GDCLASS(AnimationTrackEditor, VBoxContainer);
+ friend class AnimationTimelineEdit;
Ref<Animation> animation;
bool read_only = false;