diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-09-04 17:23:00 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-09-04 17:23:08 +0300 |
commit | fb5e2f56109e825ce3c446f80e075ee3dde81c3d (patch) | |
tree | 20b5808415568f503b4ed4b56d3d4f50b5fe8cee /source/blender/freestyle | |
parent | ee49ce482a797a5937829de497abd69bcd1edb48 (diff) |
Cleanup: Clang-Tidy bugprone-incorrect-roundings fixes
Should cause no noticeable difference.
Diffstat (limited to 'source/blender/freestyle')
-rw-r--r-- | source/blender/freestyle/intern/stroke/StrokeRep.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/freestyle/intern/stroke/StrokeRep.cpp b/source/blender/freestyle/intern/stroke/StrokeRep.cpp index 661c144476c..fe12727b0c0 100644 --- a/source/blender/freestyle/intern/stroke/StrokeRep.cpp +++ b/source/blender/freestyle/intern/stroke/StrokeRep.cpp @@ -19,6 +19,8 @@ * \brief Class to define the representation of a stroke (for display purpose) */ +#include <cmath> + #include "StrokeRep.h" #include "Stroke.h" #include "StrokeAdvancedIterators.h" @@ -573,7 +575,7 @@ void Strip::computeTexCoordWithTips(const vector<StrokeVertex *> &iStrokeVertice v = iStrokeVertices.begin(); vend = iStrokeVertices.end(); l = (*v)->strokeLength() / spacedThickness; - tiles = int(l + 0.5); // round to the nearest + tiles = std::roundf(l); // round to the nearest fact = (float(tiles) + 0.5) / l; #if 0 |