[Bf-blender-cvs] [fd5e9294734] temp-gpencil-fill: GPencil: avoid double loop

Antonio Vazquez noreply at git.blender.org
Wed Feb 3 14:27:00 CET 2021


Commit: fd5e9294734ffda5f61c8988a23b8fa6dac42e71
Author: Antonio Vazquez
Date:   Wed Feb 3 14:26:55 2021 +0100
Branches: temp-gpencil-fill
https://developer.blender.org/rBfd5e9294734ffda5f61c8988a23b8fa6dac42e71

GPencil: avoid double loop

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

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

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

diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index 983a0dfb368..f140a3ed4eb 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -2006,7 +2006,13 @@ static int gpencil_fill_modal(bContext *C, wmOperator *op, const wmEvent *event)
                 tgpf->region->winy = (short)tgpf->bwiny;
                 tgpf->region->winrct = tgpf->brect;
                 if (!tgpf->done) {
-                  tgpf->zoom = 1.0f;
+                  /* If the zoom was not set before, avoid a loop. */
+                  if (tgpf->zoom == 1.0f) {
+                    loop_limit++;
+                  }
+                  else {
+                    tgpf->zoom = 1.0f;
+                  }
                 }
                 loop_limit++;
               }



More information about the Bf-blender-cvs mailing list