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:
authorSybren A. Stüvel <sybren@blender.org>2020-09-04 17:23:00 +0300
committerSybren A. Stüvel <sybren@blender.org>2020-09-04 17:23:08 +0300
commitfb5e2f56109e825ce3c446f80e075ee3dde81c3d (patch)
tree20b5808415568f503b4ed4b56d3d4f50b5fe8cee /source/blender/blenkernel/intern/subdiv_ccg_mask.c
parentee49ce482a797a5937829de497abd69bcd1edb48 (diff)
Cleanup: Clang-Tidy bugprone-incorrect-roundings fixes
Should cause no noticeable difference.
Diffstat (limited to 'source/blender/blenkernel/intern/subdiv_ccg_mask.c')
-rw-r--r--source/blender/blenkernel/intern/subdiv_ccg_mask.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/subdiv_ccg_mask.c b/source/blender/blenkernel/intern/subdiv_ccg_mask.c
index 0c02303dc2f..10cd7039948 100644
--- a/source/blender/blenkernel/intern/subdiv_ccg_mask.c
+++ b/source/blender/blenkernel/intern/subdiv_ccg_mask.c
@@ -21,6 +21,8 @@
* \ingroup bke
*/
+#include <math.h>
+
#include "BKE_subdiv_ccg.h"
#include "DNA_mesh_types.h"
@@ -87,8 +89,8 @@ BLI_INLINE float read_mask_grid(const GridPaintMask *mask_grid,
return 0;
}
const int grid_size = BKE_subdiv_grid_size_from_level(mask_grid->level);
- const int x = (grid_u * (grid_size - 1) + 0.5f);
- const int y = (grid_v * (grid_size - 1) + 0.5f);
+ const int x = roundf(grid_u * (grid_size - 1));
+ const int y = roundf(grid_v * (grid_size - 1));
return mask_grid->data[y * grid_size + x];
}