From 29e496e768cd850f731521c9bb95e017e09885be Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 8 Oct 2021 11:57:42 +1100 Subject: Cleanup: remove redundant cursor copy, print --- source/blender/editors/uvedit/uvedit_unwrap_ops.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'source/blender/editors/uvedit') diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index 38233b55d15..89490e59bd8 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -171,7 +171,7 @@ bool ED_uvedit_udim_params_from_image_space(const SpaceImage *sima, int active_udim = 1001; /* NOTE: Presently, when UDIM grid and tiled image are present together, only active tile for * the tiled image is considered. */ - Image *image = sima->image; + const Image *image = sima->image; if (image && image->source == IMA_SRC_TILED) { ImageTile *active_tile = BLI_findlink(&image->tiles, image->active_tile_index); if (active_tile) { @@ -181,11 +181,10 @@ bool ED_uvedit_udim_params_from_image_space(const SpaceImage *sima, else { /* TODO: Support storing an active UDIM when there are no tiles present. * Until then, use 2D cursor to find the active tile index for the UDIM grid. */ - const float cursor_loc[2] = {sima->cursor[0], sima->cursor[1]}; - if (uv_coords_isect_udim(sima->image, sima->tile_grid_shape, cursor_loc)) { + if (uv_coords_isect_udim(sima->image, sima->tile_grid_shape, sima->cursor)) { int tile_number = 1001; - tile_number += floorf(cursor_loc[1]) * 10; - tile_number += floorf(cursor_loc[0]); + tile_number += floorf(sima->cursor[1]) * 10; + tile_number += floorf(sima->cursor[0]); active_udim = tile_number; } } -- cgit v1.2.3