@@ -6538,7 +6538,6 @@ void AnimationTrackEditor::goto_next_step(bool p_from_mouse_event, bool p_timeli
6538
6538
}
6539
6539
6540
6540
void AnimationTrackEditor::_edit_menu_pressed (int p_option) {
6541
- last_menu_track_opt = p_option;
6542
6541
switch (p_option) {
6543
6542
case EDIT_COPY_TRACKS: {
6544
6543
track_copy_select->clear ();
@@ -6698,11 +6697,15 @@ void AnimationTrackEditor::_edit_menu_pressed(int p_option) {
6698
6697
6699
6698
undo_redo->commit_action ();
6700
6699
} break ;
6701
-
6702
- case EDIT_SCALE_SELECTION:
6700
+ case EDIT_SCALE_SELECTION: {
6701
+ scale_dialog->popup_centered (Size2 (200 , 100 ) * EDSCALE);
6702
+ scale->get_line_edit ()->grab_focus ();
6703
+ scale_from_cursor = false ;
6704
+ } break ;
6703
6705
case EDIT_SCALE_FROM_CURSOR: {
6704
6706
scale_dialog->popup_centered (Size2 (200 , 100 ) * EDSCALE);
6705
6707
scale->get_line_edit ()->grab_focus ();
6708
+ scale_from_cursor = true ;
6706
6709
} break ;
6707
6710
case EDIT_SCALE_CONFIRM: {
6708
6711
if (selection.is_empty ()) {
@@ -6725,9 +6728,8 @@ void AnimationTrackEditor::_edit_menu_pressed(int p_option) {
6725
6728
}
6726
6729
6727
6730
len = to_t - from_t ;
6728
- if (last_menu_track_opt == EDIT_SCALE_FROM_CURSOR ) {
6731
+ if (scale_from_cursor ) {
6729
6732
pivot = timeline->get_play_position ();
6730
-
6731
6733
} else {
6732
6734
pivot = from_t ;
6733
6735
}
@@ -6769,7 +6771,7 @@ void AnimationTrackEditor::_edit_menu_pressed(int p_option) {
6769
6771
to_restore.push_back (amr);
6770
6772
}
6771
6773
6772
- #define NEW_POS (m_ofs ) (((s > 0 ) ? m_ofs : from_t + (len - (m_ofs - from_t ))) - pivot) * Math::abs (s) + from_t
6774
+ #define NEW_POS (m_ofs ) (((s > 0 ) ? m_ofs : from_t + (len - (m_ofs - from_t ))) - pivot) * Math::abs (s) + pivot
6773
6775
// 3 - Move the keys (re insert them).
6774
6776
for (RBMap<SelectedKey, KeyInfo>::Element *E = selection.back(); E; E = E->prev ()) {
6775
6777
float newpos = NEW_POS (E->get ().pos );
0 commit comments