diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-10-08 03:57:42 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-10-08 03:57:42 +0300 |
commit | 29e496e768cd850f731521c9bb95e017e09885be (patch) | |
tree | 8d2e8b6a86dff9d47fc75ba3a530d789149138d6 /source/blender/editors/uvedit | |
parent | 23791db1456332ee83b16156dc117eaa873a765c (diff) |
Cleanup: remove redundant cursor copy, print
Diffstat (limited to 'source/blender/editors/uvedit')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_unwrap_ops.c | 9 |
1 files changed, 4 insertions, 5 deletions
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; } } |