diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-07-11 16:50:43 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-07-11 16:50:43 +0300 |
commit | 06312c6d2db8a6d959bed153f76a28f9faf866f8 (patch) | |
tree | 0c0e419621bf295ca18133d84eb6d35897584d7d /source/blender/editors/space_text/text_undo.c | |
parent | 3fe0c32fae20be4146bfa20fe64f56f5716a132b (diff) | |
parent | 7ad21c3876c2453f11fd509a0157639d615567fc (diff) |
Merge branch 'master' into blender-v2.80-releasev2.80-rc1
Diffstat (limited to 'source/blender/editors/space_text/text_undo.c')
-rw-r--r-- | source/blender/editors/space_text/text_undo.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/editors/space_text/text_undo.c b/source/blender/editors/space_text/text_undo.c index 7710c5637a2..66cbaa8bb5b 100644 --- a/source/blender/editors/space_text/text_undo.c +++ b/source/blender/editors/space_text/text_undo.c @@ -130,7 +130,7 @@ static void text_undosys_step_decode_redo_impl(Text *text, TextUndoStep *us) us->step.is_applied = true; } -static void text_undosys_step_decode_undo(TextUndoStep *us) +static void text_undosys_step_decode_undo(TextUndoStep *us, bool is_final) { TextUndoStep *us_iter = us; while (us_iter->step.next && (us_iter->step.next->type == us_iter->step.type)) { @@ -140,13 +140,16 @@ static void text_undosys_step_decode_undo(TextUndoStep *us) us_iter = (TextUndoStep *)us_iter->step.next; } Text *text_prev = NULL; - while (us_iter != us) { + while ((us_iter != us) || (is_final && us_iter == us)) { Text *text = us_iter->text_ref.ptr; text_undosys_step_decode_undo_impl(text, us_iter); if (text_prev != text) { text_update_edited(text); text_prev = text; } + if (is_final) { + break; + } us_iter = (TextUndoStep *)us_iter->step.prev; } } @@ -175,15 +178,13 @@ static void text_undosys_step_decode_redo(TextUndoStep *us) } } -static void text_undosys_step_decode(struct bContext *C, - struct Main *UNUSED(bmain), - UndoStep *us_p, - int dir) +static void text_undosys_step_decode( + struct bContext *C, struct Main *UNUSED(bmain), UndoStep *us_p, int dir, bool is_final) { TextUndoStep *us = (TextUndoStep *)us_p; if (dir < 0) { - text_undosys_step_decode_undo(us); + text_undosys_step_decode_undo(us, is_final); } else { text_undosys_step_decode_redo(us); |