diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-07-26 06:13:47 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-07-26 06:14:24 +0300 |
commit | ac7fe46ec393b1f7273f6896498c280dff7f7ff0 (patch) | |
tree | b5f1b6c7d91c6f677145c9f330cbeea7dbcbf6d8 /source/blender/editors/sculpt_paint/paint_image_undo.c | |
parent | cb10bd379b2d4b33c1626c7bff3c571f26e1493c (diff) |
Fix T67709: Texture paint undo gets out of sync
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image_undo.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_undo.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_undo.c b/source/blender/editors/sculpt_paint/paint_image_undo.c index e7f100ebacb..1527ba31040 100644 --- a/source/blender/editors/sculpt_paint/paint_image_undo.c +++ b/source/blender/editors/sculpt_paint/paint_image_undo.c @@ -507,7 +507,7 @@ static void image_undosys_step_decode_redo_impl(ImageUndoStep *us) us->step.is_applied = true; } -static void image_undosys_step_decode_undo(ImageUndoStep *us) +static void image_undosys_step_decode_undo(ImageUndoStep *us, bool is_final) { ImageUndoStep *us_iter = us; while (us_iter->step.next && (us_iter->step.next->type == us_iter->step.type)) { @@ -516,8 +516,11 @@ static void image_undosys_step_decode_undo(ImageUndoStep *us) } us_iter = (ImageUndoStep *)us_iter->step.next; } - while (us_iter != us) { + while (us_iter != us || (is_final && us_iter == us)) { image_undosys_step_decode_undo_impl(us_iter); + if (is_final) { + break; + } us_iter = (ImageUndoStep *)us_iter->step.prev; } } @@ -541,7 +544,7 @@ static void image_undosys_step_decode_redo(ImageUndoStep *us) } static void image_undosys_step_decode( - struct bContext *C, struct Main *bmain, UndoStep *us_p, int dir, bool UNUSED(is_final)) + struct bContext *C, struct Main *bmain, UndoStep *us_p, int dir, bool is_final) { ImageUndoStep *us = (ImageUndoStep *)us_p; #if 0 @@ -549,7 +552,7 @@ static void image_undosys_step_decode( #endif if (dir < 0) { - image_undosys_step_decode_undo(us); + image_undosys_step_decode_undo(us, is_final); } else { image_undosys_step_decode_redo(us); |