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:
authorJacques Lucke <jacques@blender.org>2020-05-13 13:50:14 +0300
committerJacques Lucke <jacques@blender.org>2020-05-13 13:50:14 +0300
commit2afb59757268cc71e7780f683610b2724853cac0 (patch)
tree869058088297f479d33b9aeafb056b5b02506c45 /source/blender/blenlib/intern/math_base_inline.c
parenteb27595ac486c2321a12e77f832a1c37bccbd143 (diff)
Fix T76665: Wrong files selected when using box select
Reviewers: Severin Differential Revision: https://developer.blender.org/D7705
Diffstat (limited to 'source/blender/blenlib/intern/math_base_inline.c')
-rw-r--r--source/blender/blenlib/intern/math_base_inline.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_base_inline.c b/source/blender/blenlib/intern/math_base_inline.c
index e0cac508d28..6db3ea819a4 100644
--- a/source/blender/blenlib/intern/math_base_inline.c
+++ b/source/blender/blenlib/intern/math_base_inline.c
@@ -356,6 +356,14 @@ MINLINE int divide_floor_i(int a, int b)
}
/**
+ * Integer division that ceils the result, instead of flooring like normal C division.
+ */
+MINLINE uint divide_ceil_u(uint a, uint b)
+{
+ return (a + b - 1) / b;
+}
+
+/**
* modulo that handles negative numbers, works the same as Python's.
*/
MINLINE int mod_i(int i, int n)