diff options
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r-- | source/blender/editors/transform/transform_mode_resize.c | 8 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_mode_translate.c | 8 |
2 files changed, 2 insertions, 14 deletions
diff --git a/source/blender/editors/transform/transform_mode_resize.c b/source/blender/editors/transform/transform_mode_resize.c index bbe1cfdf521..1ccda96fecb 100644 --- a/source/blender/editors/transform/transform_mode_resize.c +++ b/source/blender/editors/transform/transform_mode_resize.c @@ -137,13 +137,7 @@ static bool clip_uv_transform_resize(TransInfo *t, float vec[2]) /* If tiled image then constrain to correct/closest UDIM tile, else 0-1 UV space. */ if (is_tiled_image) { - int nearest_tile_index = BKE_image_find_nearest_tile(image, t->center_global); - if (nearest_tile_index != -1) { - nearest_tile_index -= 1001; - /* Getting coordinates of nearest tile from the tile index. */ - base_offset[0] = nearest_tile_index % 10; - base_offset[1] = nearest_tile_index / 10; - } + BKE_image_find_nearest_tile_with_offset(image, t->center_global, base_offset); } /* Assume no change is required. */ diff --git a/source/blender/editors/transform/transform_mode_translate.c b/source/blender/editors/transform/transform_mode_translate.c index 67bdeb3fed0..04a41814b53 100644 --- a/source/blender/editors/transform/transform_mode_translate.c +++ b/source/blender/editors/transform/transform_mode_translate.c @@ -448,13 +448,7 @@ static bool clip_uv_transform_translation(TransInfo *t, float vec[2]) /* If tiled image then constrain to correct/closest UDIM tile, else 0-1 UV space. */ if (is_tiled_image) { - int nearest_tile_index = BKE_image_find_nearest_tile(image, t->center_global); - if (nearest_tile_index != -1) { - nearest_tile_index -= 1001; - /* Getting coordinates of nearest tile from the tile index. */ - base_offset[0] = nearest_tile_index % 10; - base_offset[1] = nearest_tile_index / 10; - } + BKE_image_find_nearest_tile_with_offset(image, t->center_global, base_offset); } float min[2], max[2]; |