Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2020-04-25 20:40:12 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-04-25 20:40:12 +0300
commitf418eddf8e1c924ee45a8dec7b15a0f8bc0d1a8a (patch)
treef01f5f31f93242adc67069845829f24f65230124 /source/blender/editors/gpencil
parente54a206e157f24f149ecc18aa1d30f10a53f9616 (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')
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c5
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))) {