[Bf-blender-cvs] [7f126affb2a] lineart-shadow: LineArt: point on edge tolerance.
YimingWu
noreply at git.blender.org
Tue Aug 17 05:53:16 CEST 2021
Commit: 7f126affb2a6cbdddffb981043d7b75cd0c976cb
Author: YimingWu
Date: Tue Aug 17 11:50:58 2021 +0800
Branches: lineart-shadow
https://developer.blender.org/rB7f126affb2a6cbdddffb981043d7b75cd0c976cb
LineArt: point on edge tolerance.
===================================================================
M source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
===================================================================
diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index bb1772d272d..ffeb086f92f 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -618,7 +618,7 @@ static int lineart_point_on_line_segment(double v[2], double v0[2], double v1[2]
}
else if (v[0] == v1[0]) {
c2 = ratiod(v0[1], v1[1], v[1]);
- return (c2 >= 0 && c2 <= 1);
+ return (c2 >= -DBL_TRIANGLE_LIM && c2 <= 1 + DBL_TRIANGLE_LIM);
}
if (v1[1] - v0[1]) {
@@ -626,10 +626,10 @@ static int lineart_point_on_line_segment(double v[2], double v0[2], double v1[2]
}
else if (v[1] == v1[1]) {
c1 = ratiod(v0[0], v1[0], v[0]);
- return (c1 >= 0 && c1 <= 1);
+ return (c1 >= -DBL_TRIANGLE_LIM && c1 <= 1 + DBL_TRIANGLE_LIM);
}
- if (LRT_DOUBLE_CLOSE_ENOUGH(c1, c2) && c1 >= 0 && c1 <= 1) {
+ if (LRT_DOUBLE_CLOSE_ENOUGH(c1, c2) && c1 >= -DBL_TRIANGLE_LIM && c1 <= 1 + DBL_TRIANGLE_LIM) {
return 1;
}
More information about the Bf-blender-cvs
mailing list