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>2021-02-24 18:43:18 +0300
committerAntonio Vazquez <blendergit@gmail.com>2021-02-24 18:44:34 +0300
commitb22204fa370d93e4b484407942d35aaa2ad986a1 (patch)
tree9aa5fb8e0a020f7a85d6de36f0034ec3adb72b85
parentc778fd981e636d99f819806471e2ee83a3cb76c0 (diff)
Cleanup: Simplify vector direction comparison
Multiply the two number together. If the sign of the result is positive, then the sign was the same. If the sign of the result is negative, then the signs were different.
-rw-r--r--source/blender/editors/gpencil/gpencil_interpolate.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c
index ff5ce7101f1..ae3dae326c0 100644
--- a/source/blender/editors/gpencil/gpencil_interpolate.c
+++ b/source/blender/editors/gpencil/gpencil_interpolate.c
@@ -237,8 +237,8 @@ static bool gpencil_stroke_need_flip(Depsgraph *depsgraph,
float v1[2], v2[2];
sub_v2_v2v2(v1, v_from_end, v_from_start);
sub_v2_v2v2(v2, v_to_end, v_to_start);
- if (((v1[0] > 0.0f && v2[0] < 0.0f) || (v1[0] < 0.0f && v2[0] > 0.0f)) &&
- ((v1[1] > 0.0f && v2[1] < 0.0f) || (v1[1] < 0.0f && v2[1] > 0.0f))) {
+ mul_v2_v2v2(v1, v1, v2);
+ if ((v1[0] < 0.0f) && (v1[1] < 0.0f)) {
return true;
}
}