[Bf-blender-cvs] [f0ba75639a9] greasepencil-refactor: GPencil: Refactor: Fix frame drawn without color when in onion skin + loop

Clément Foucault noreply at git.blender.org
Sat Jan 4 00:34:34 CET 2020


Commit: f0ba75639a999b934b1d410f1d4b720d5e890fb1
Author: Clément Foucault
Date:   Sat Jan 4 00:34:22 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rBf0ba75639a999b934b1d410f1d4b720d5e890fb1

GPencil: Refactor: Fix frame drawn without color when in onion skin + loop

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

M	source/blender/draw/engines/gpencil/gpencil_draw_utils.c

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

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index 7270c257e52..eec8a43ae3f 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -115,7 +115,7 @@ void gpencil_object_visible_stroke_iter(
               /* We wrap the value using the last frame and 0 as reference. */
               /* FIXME: This might not be good for animations not starting at 0. */
               int shift = (onion_mode_abs) ? last_gpf->framenum : last_gpf->runtime.frameid;
-              delta += (delta < 0) ? shift : -shift;
+              delta += (delta < 0) ? (shift + 1) : -(shift + 1);
               /* Test again with wrapped value. */
               is_in_range = (-delta <= gpd->gstep) && (delta <= gpd->gstep_next);
             }



More information about the Bf-blender-cvs mailing list