[Bf-blender-cvs] [f418eddf8e1] blender-v2.83-release: GPencil: Fix unreported small offset when use Stroke mode
Antonio Vazquez
noreply at git.blender.org
Sat Apr 25 19:42:36 CEST 2020
Commit: f418eddf8e1c924ee45a8dec7b15a0f8bc0d1a8a
Author: Antonio Vazquez
Date: Sat Apr 25 19:40:12 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rBf418eddf8e1c924ee45a8dec7b15a0f8bc0d1a8a
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.
===================================================================
M source/blender/editors/gpencil/gpencil_paint.c
===================================================================
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))) {
More information about the Bf-blender-cvs
mailing list