[Bf-blender-cvs] [87c7135da5d] master: Cleanup: GPencil small improvements in comparison

Antonio Vazquez noreply at git.blender.org
Mon Sep 9 16:26:29 CEST 2019


Commit: 87c7135da5dbc2df058e433b9df98de454806268
Author: Antonio Vazquez
Date:   Mon Sep 9 16:25:44 2019 +0200
Branches: master
https://developer.blender.org/rB87c7135da5dbc2df058e433b9df98de454806268

Cleanup: GPencil small improvements in comparison

As the function `gpencil_onion_active()` has a loop, if some condition is false before we can avoid the 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 e8a7981cb66..d49cc728551 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -149,7 +149,7 @@ static void gpencil_calc_vertex(GPENCIL_StorageList *stl,
                            (bool)((draw_ctx->v3d->flag2 & V3D_HIDE_OVERLAYS) == 0) :
                            true;
   const bool do_onion = (bool)((gpd->flag & GP_DATA_STROKE_WEIGHTMODE) == 0) && overlay &&
-                        main_onion && gpencil_onion_active(gpd) && !playing;
+                        main_onion && !playing && gpencil_onion_active(gpd);
 
   const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
 
@@ -1721,7 +1721,7 @@ static void gpencil_shgroups_create(GPENCIL_e_data *e_data,
                            true;
   const bool main_onion = v3d != NULL ? (v3d->gp_flag & V3D_GP_SHOW_ONION_SKIN) : true;
   const bool do_onion = (bool)((gpd->flag & GP_DATA_STROKE_WEIGHTMODE) == 0) && main_onion &&
-                        gpencil_onion_active(gpd) && overlay;
+                        overlay && gpencil_onion_active(gpd);
 
   int start_stroke = 0;
   int start_point = 0;



More information about the Bf-blender-cvs mailing list