diff options
author | Marcelo Demian Gómez <mdemiang> | 2021-03-27 16:58:18 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2021-03-27 17:01:36 +0300 |
commit | e7c4c9e538560d7278403fbc728fe6b9e9238334 (patch) | |
tree | 74ddfc4aa0c56b9bf9cf4434eb5392c47d84843a | |
parent | dc873c4a7be494a6a3d8b4481ca6a1c096d361cd (diff) |
Fix T86967 : Artifacts when tracing image to Grease Pencil
Tracing images to grease pencil objects creates sometimes artifacts, as seen, for example, when tracing the attached image. {F9910821}
I have found the same behavior both in the 2.92 release and in the current 2.93 master.
The artifacts are caused by a variable that's not initialized or updated when finding a point tagged as POTRACE_CORNER.
This patch solves this issue.
Maniphest Tasks: T86967
Differential Revision: https://developer.blender.org/D10832
-rw-r--r-- | source/blender/editors/gpencil/gpencil_trace_utils.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/gpencil_trace_utils.c b/source/blender/editors/gpencil/gpencil_trace_utils.c index ada777d43f3..7e4fa2d9bda 100644 --- a/source/blender/editors/gpencil/gpencil_trace_utils.c +++ b/source/blender/editors/gpencil/gpencil_trace_utils.c @@ -308,9 +308,16 @@ void ED_gpencil_trace_data_to_strokes(Main *bmain, if (gps->totpoints == 0) { add_point(gps, scalef, offset, c[n - 1][2].x, c[n - 1][2].y); } + else { + add_point(gps, scalef, offset, last[0],last[1]); + } + add_point(gps, scalef, offset, c[i][1].x, c[i][1].y); add_point(gps, scalef, offset, c[i][2].x, c[i][2].y); + + last[0] = c[i][2].x; + last[1]= c[i][2].y; break; } case POTRACE_CURVETO: { |