[Bf-blender-cvs] [c821aa8ca76] master: GPencil: Fix unreported refresh of stroke after using Arrange operator

Antonio Vazquez noreply at git.blender.org
Thu Dec 3 17:18:26 CET 2020


Commit: c821aa8ca76b219e51bbc1f6b840efd6152c045e
Author: Antonio Vazquez
Date:   Thu Dec 3 17:18:01 2020 +0100
Branches: master
https://developer.blender.org/rBc821aa8ca76b219e51bbc1f6b840efd6152c045e

GPencil: Fix unreported refresh of stroke after using Arrange operator

When change the order of the stroke using the arrange operator, the arrange was done, but the viewport did not display the result until you refresh the viewport.

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

M	source/blender/editors/gpencil/gpencil_data.c

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

diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c
index a963632a01b..33a1469beab 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -1586,6 +1586,7 @@ static int gpencil_stroke_arrange_exec(bContext *C, wmOperator *op)
                 gps = link->data;
                 BLI_remlink(&gpf->strokes, gps);
                 BLI_addtail(&gpf->strokes, gps);
+                changed = true;
               }
               break;
             /* Bring Forward */
@@ -1593,6 +1594,7 @@ static int gpencil_stroke_arrange_exec(bContext *C, wmOperator *op)
               LISTBASE_FOREACH_BACKWARD (LinkData *, link, &selected) {
                 gps = link->data;
                 BLI_listbase_link_move(&gpf->strokes, gps, 1);
+                changed = true;
               }
               break;
             /* Send Backward */
@@ -1600,6 +1602,7 @@ static int gpencil_stroke_arrange_exec(bContext *C, wmOperator *op)
               LISTBASE_FOREACH (LinkData *, link, &selected) {
                 gps = link->data;
                 BLI_listbase_link_move(&gpf->strokes, gps, -1);
+                changed = true;
               }
               break;
             /* Send to Back */
@@ -1608,12 +1611,12 @@ static int gpencil_stroke_arrange_exec(bContext *C, wmOperator *op)
                 gps = link->data;
                 BLI_remlink(&gpf->strokes, gps);
                 BLI_addhead(&gpf->strokes, gps);
+                changed = true;
               }
               break;
             default:
               BLI_assert(0);
               break;
-              changed = true;
           }
         }
         BLI_freelistN(&selected);



More information about the Bf-blender-cvs mailing list