Commit: ac7fe46ec393b1f7273f6896498c280dff7f7ff0
Author: Campbell Barton
Date:   Fri Jul 26 13:13:47 2019 +1000
Branches: master
https://developer.blender.org/rBac7fe46ec393b1f7273f6896498c280dff7f7ff0

Fix T67709: Texture paint undo gets out of sync

===================================================================

M       source/blender/editors/sculpt_paint/paint_image_undo.c

===================================================================

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);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to