Commit: fd552a77d773857d3bac2248d9c2c1ef2d12d345
Author: Antonioya
Date:   Wed Jan 2 18:10:02 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rBfd552a77d773857d3bac2248d9c2c1ef2d12d345

Revert "GP: Remove correction factor in Cutter"

This reverts commit c05ac7bc5842f297684f4da47dd61adca3778381.

===================================================================

M       source/blender/editors/gpencil/gpencil_utils.c

===================================================================

diff --git a/source/blender/editors/gpencil/gpencil_utils.c 
b/source/blender/editors/gpencil/gpencil_utils.c
index f1db854de9c..80770eb2961 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -2080,6 +2080,15 @@ static float gp_calc_factor(float p2d_a1[2], float 
p2d_a2[2], float r_hit2d[2])
        float dist2 = len_squared_v2v2(p2d_a1, r_hit2d);
        float f = dist1 > 0.0f ? dist2 / dist1 : 0.0f;
 
+       /* apply a correction factor */
+       float v1[2];
+       interp_v2_v2v2(v1, p2d_a1, p2d_a2, f);
+       float dist3 = len_squared_v2v2(p2d_a1, v1);
+       float f1 = dist1 > 0.0f ? dist3 / dist1 : 0.0f;
+       f = f + (f - f1);
+
+       interp_v2_v2v2(v1, p2d_a1, p2d_a2, f);
+
        return f;
 }

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to