diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2020-04-25 20:40:12 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2020-04-25 20:40:12 +0300 |
commit | f418eddf8e1c924ee45a8dec7b15a0f8bc0d1a8a (patch) | |
tree | f01f5f31f93242adc67069845829f24f65230124 /source/blender/editors/gpencil/gpencil_paint.c | |
parent | e54a206e157f24f149ecc18aa1d30f10a53f9616 (diff) |
GPencil: Fix unreported small offset when use Stroke mode
When using the Stroke mode, the reprojection function add a small offset of 0.5 to +X and +Y. Now this effect is removed subtracting this value before doing the conversion.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_paint.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index e1854ae8c03..bd7dfecf692 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -445,7 +445,10 @@ static void gp_stroke_convertcoords(tGPsdata *p, const float mval[2], float out[ } int mval_i[2]; - round_v2i_v2fl(mval_i, mval); + float rmval[2]; + rmval[0] = mval[0] - 0.5f; + rmval[1] = mval[1] - 0.5f; + round_v2i_v2fl(mval_i, rmval); if (gpencil_project_check(p) && (ED_view3d_autodist_simple(p->region, mval_i, out, 0, depth))) { |