summaryrefslogtreecommitdiff
path: root/editor/animation_track_editor.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-01-20 22:50:39 +0100
committerGitHub <noreply@github.com>2022-01-20 22:50:39 +0100
commitcfb986c6318f61b4b67bc3af4188c06a0717bd9a (patch)
tree373b028bfbae8d082db1038e222b70543c111185 /editor/animation_track_editor.cpp
parente6170aae39194a6ada312ff8a3f53a36bf16aff8 (diff)
parentbd448e5535686a4473d185f4103b4ac4dedf0c71 (diff)
Merge pull request #51452 from omar-polo/fix-macros
Diffstat (limited to 'editor/animation_track_editor.cpp')
-rw-r--r--editor/animation_track_editor.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index 287ea5c564..8d1d4cd364 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -5700,16 +5700,16 @@ void AnimationTrackEditor::_edit_menu_pressed(int p_option) {
to_restore.push_back(amr);
}
-#define _NEW_POS(m_ofs) (((s > 0) ? m_ofs : from_t + (len - (m_ofs - from_t))) - pivot) * ABS(s) + from_t
+#define NEW_POS(m_ofs) (((s > 0) ? m_ofs : from_t + (len - (m_ofs - from_t))) - pivot) * ABS(s) + from_t
// 3 - Move the keys (re insert them).
for (Map<SelectedKey, KeyInfo>::Element *E = selection.back(); E; E = E->prev()) {
- float newpos = _NEW_POS(E->get().pos);
+ float newpos = NEW_POS(E->get().pos);
undo_redo->add_do_method(animation.ptr(), "track_insert_key", E->key().track, newpos, animation->track_get_key_value(E->key().track, E->key().key), animation->track_get_key_transition(E->key().track, E->key().key));
}
// 4 - (Undo) Remove inserted keys.
for (Map<SelectedKey, KeyInfo>::Element *E = selection.back(); E; E = E->prev()) {
- float newpos = _NEW_POS(E->get().pos);
+ float newpos = NEW_POS(E->get().pos);
undo_redo->add_undo_method(animation.ptr(), "track_remove_key_at_time", E->key().track, newpos);
}
@@ -5729,13 +5729,13 @@ void AnimationTrackEditor::_edit_menu_pressed(int p_option) {
// 7-reselect.
for (Map<SelectedKey, KeyInfo>::Element *E = selection.back(); E; E = E->prev()) {
float oldpos = E->get().pos;
- float newpos = _NEW_POS(oldpos);
+ float newpos = NEW_POS(oldpos);
if (newpos >= 0) {
undo_redo->add_do_method(this, "_select_at_anim", animation, E->key().track, newpos);
}
undo_redo->add_undo_method(this, "_select_at_anim", animation, E->key().track, oldpos);
}
-#undef _NEW_POS
+#undef NEW_POS
undo_redo->commit_action();
} break;
case EDIT_DUPLICATE_SELECTION: {