[Bf-blender-cvs] [55bf704427e] blender-v2.93-release: Fix T88005: GPencil inverse fill leaves unwanted line at viewport edge.

Antonio Vazquez noreply at git.blender.org
Mon May 3 17:10:44 CEST 2021


Commit: 55bf704427e9d6d791fe225a27072c36f23d9eb9
Author: Antonio Vazquez
Date:   Mon May 3 17:10:13 2021 +0200
Branches: blender-v2.93-release
https://developer.blender.org/rB55bf704427e9d6d791fe225a27072c36f23d9eb9

Fix T88005: GPencil inverse fill leaves unwanted line at viewport edge.

There was a function to set 2 pixels wide for inverse filling, but this must not be done in the borders of the image.

Now, the borders are checked before set 2 pixels.

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

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 3f86e5474c5..bb0a2916d2d 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -1029,9 +1029,15 @@ static void gpencil_invert_image(tGPDfill *tgpf)
     /* Red->Green */
     else if (color[0] == 1.0f) {
       set_pixel(ibuf, v, fill_col[1]);
-      /* Add thickness of 2 pixels to avoid too thin lines. */
-      int offset = (v % ibuf->x < center) ? 1 : -1;
-      set_pixel(ibuf, v + offset, fill_col[1]);
+      /* Add thickness of 2 pixels to avoid too thin lines, but avoid extremes of the pixel line.
+       */
+      int row = v / ibuf->x;
+      int lowpix = row * ibuf->x;
+      int highpix = lowpix + ibuf->x - 1;
+      if ((v > lowpix) && (v < highpix)) {
+        int offset = (v % ibuf->x < center) ? 1 : -1;
+        set_pixel(ibuf, v + offset, fill_col[1]);
+      }
     }
     else {
       /* Set to Transparent. */



More information about the Bf-blender-cvs mailing list