diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-11-01 14:06:04 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-11-01 15:05:57 +0300 |
commit | 1b974563b17b3a1ee02d81df952a66ecf66919c4 (patch) | |
tree | 1a68bb4aafe7d58a1e3957a92c150be4cf936ab0 /source/blender/blenlib/intern/math_vector_inline.c | |
parent | 38f57734ea1e0d6a6473bb13f91f71eac821edcc (diff) |
Fix T57529: 2D image paint fill tool not taking into account alpha.
Diffstat (limited to 'source/blender/blenlib/intern/math_vector_inline.c')
-rw-r--r-- | source/blender/blenlib/intern/math_vector_inline.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c index 715e2e65c96..37eab44c6e8 100644 --- a/source/blender/blenlib/intern/math_vector_inline.c +++ b/source/blender/blenlib/intern/math_vector_inline.c @@ -1087,24 +1087,23 @@ MINLINE bool compare_v4v4_relative(const float v1[4], const float v2[4], const f MINLINE bool compare_len_v3v3(const float v1[3], const float v2[3], const float limit) { - float x, y, z; - - x = v1[0] - v2[0]; - y = v1[1] - v2[1]; - z = v1[2] - v2[2]; - - return ((x * x + y * y + z * z) <= (limit * limit)); + float d[3]; + sub_v3_v3v3(d, v1, v2); + return (dot_v3v3(d, d) <= (limit * limit)); } MINLINE bool compare_len_squared_v3v3(const float v1[3], const float v2[3], const float limit_sq) { - float x, y, z; - - x = v1[0] - v2[0]; - y = v1[1] - v2[1]; - z = v1[2] - v2[2]; + float d[3]; + sub_v3_v3v3(d, v1, v2); + return (dot_v3v3(d, d) <= limit_sq); +} - return ((x * x + y * y + z * z) <= limit_sq); +MINLINE bool compare_len_squared_v4v4(const float v1[4], const float v2[4], const float limit_sq) +{ + float d[4]; + sub_v4_v4v4(d, v1, v2); + return (dot_v4v4(d, d) <= limit_sq); } /** |