diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2020-08-12 20:18:59 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2020-08-12 23:48:06 +0300 |
commit | 01636ed159c7dede57236f7a801d3cfcae0b9750 (patch) | |
tree | 81b575d84f43200a9f7bb166c333c2ad0574f8c0 /source/blender/blenkernel/intern/gpencil_curve.c | |
parent | b126e38f6bcdd6deace59fe89a3200f004814018 (diff) |
GPencil: Fix unreported problem in merge similar materials
When two similar colors were adjacent, the colors were not merged.
Diffstat (limited to 'source/blender/blenkernel/intern/gpencil_curve.c')
-rw-r--r-- | source/blender/blenkernel/intern/gpencil_curve.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/gpencil_curve.c b/source/blender/blenkernel/intern/gpencil_curve.c index 044cc0164cf..d2c9ef0b3bc 100644 --- a/source/blender/blenkernel/intern/gpencil_curve.c +++ b/source/blender/blenkernel/intern/gpencil_curve.c @@ -64,10 +64,12 @@ static int gpencil_check_same_material_color(Object *ob_gp, float hsv_stroke[4], hsv_fill[4]; copy_v4_v4(color_cu, color_stroke); + zero_v3(hsv_stroke); rgb_to_hsv_v(color_cu, hsv_stroke); hsv_stroke[3] = color_stroke[3]; copy_v4_v4(color_cu, color_fill); + zero_v3(hsv_fill); rgb_to_hsv_v(color_cu, hsv_fill); hsv_fill[3] = color_fill[3]; @@ -91,6 +93,7 @@ static int gpencil_check_same_material_color(Object *ob_gp, /* Check color with small tolerance (better result in HSV). */ float hsv2[4]; if (do_fill) { + zero_v3(hsv2); rgb_to_hsv_v(gp_style->fill_rgba, hsv2); hsv2[3] = gp_style->fill_rgba[3]; if (compare_v4v4(hsv_fill, hsv2, 0.01f)) { @@ -104,6 +107,7 @@ static int gpencil_check_same_material_color(Object *ob_gp, } if (do_stroke) { + zero_v3(hsv2); rgb_to_hsv_v(gp_style->stroke_rgba, hsv2); hsv2[3] = gp_style->stroke_rgba[3]; if (compare_v4v4(hsv_stroke, hsv2, 0.01f)) { |