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/editors/space_sequencer | |
parent | ee49ce482a797a5937829de497abd69bcd1edb48 (diff) |
Cleanup: Clang-Tidy bugprone-incorrect-roundings fixes
Should cause no noticeable difference.
Diffstat (limited to 'source/blender/editors/space_sequencer')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_draw.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/space_sequencer.c | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 6cfd33df7bf..298ed927b44 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -1262,8 +1262,8 @@ ImBuf *sequencer_ibuf_get(struct Main *bmain, render_size = BKE_sequencer_rendersize_to_scale_factor(sseq->render_size); } - rectx = render_size * scene->r.xsch + 0.5; - recty = render_size * scene->r.ysch + 0.5; + rectx = roundf(render_size * scene->r.xsch); + recty = roundf(render_size * scene->r.ysch); BKE_sequencer_new_render_data( bmain, depsgraph, scene, rectx, recty, sseq->render_size, false, &context); @@ -1800,7 +1800,7 @@ void sequencer_draw_preview(const bContext *C, /* Setup view. */ sequencer_display_size(scene, viewrect); - UI_view2d_totRect_set(v2d, viewrect[0] + 0.5f, viewrect[1] + 0.5f); + UI_view2d_totRect_set(v2d, roundf(viewrect[0] + 0.5f), roundf(viewrect[1] + 0.5f)); UI_view2d_curRect_validate(v2d); UI_view2d_view_ortho(v2d); diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c index 4a6bd0de60c..cce99cd9f08 100644 --- a/source/blender/editors/space_sequencer/space_sequencer.c +++ b/source/blender/editors/space_sequencer/space_sequencer.c @@ -21,6 +21,7 @@ * \ingroup spseq */ +#include <math.h> #include <stdio.h> #include <string.h> @@ -304,7 +305,7 @@ static void sequencer_refresh(const bContext *C, ScrArea *area) /* Final check that both preview and main height are reasonable. */ if (region_preview->sizey < 10 || region_main->sizey < 10 || region_preview->sizey + region_main->sizey > height) { - region_preview->sizey = (int)(height * 0.4f + 0.5f); + region_preview->sizey = roundf(height * 0.4f); region_main->sizey = (int)(height - region_preview->sizey); view_changed = true; } |