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:
Diffstat (limited to 'source/blender/blenlib/intern/polyfill_2d.c')
-rw-r--r--source/blender/blenlib/intern/polyfill_2d.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/polyfill_2d.c b/source/blender/blenlib/intern/polyfill_2d.c
index 575a4a06d6a..31b18079c73 100644
--- a/source/blender/blenlib/intern/polyfill_2d.c
+++ b/source/blender/blenlib/intern/polyfill_2d.c
@@ -193,7 +193,10 @@ BLI_INLINE eSign signum_enum(float a)
*/
BLI_INLINE float area_tri_signed_v2_alt_2x(const float v1[2], const float v2[2], const float v3[2])
{
- return ((v1[0] * (v2[1] - v3[1])) + (v2[0] * (v3[1] - v1[1])) + (v3[0] * (v1[1] - v2[1])));
+ float d2[2], d3[2];
+ sub_v2_v2v2(d2, v2, v1);
+ sub_v2_v2v2(d3, v3, v1);
+ return (d2[0] * d3[1]) - (d3[0] * d2[1]);
}
static eSign span_tri_v2_sign(const float v1[2], const float v2[2], const float v3[2])