summaryrefslogtreecommitdiff
path: root/scene/resources/tile_set.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-09-29 07:40:52 +0200
committerGitHub <noreply@github.com>2021-09-29 07:40:52 +0200
commitad635567b1964c3e573dedd158cf9dab09364fec (patch)
tree385f76b6b2869666120a9afdee99ba88c75aacaf /scene/resources/tile_set.cpp
parent1bf0e875d86325249d5dcecddf69edc274ada8e5 (diff)
parentfc9767abb14348c2236b487f0bc6d18de65a38fd (diff)
Merge pull request #53189 from AnilBK/use-class-specific-funcs
Diffstat (limited to 'scene/resources/tile_set.cpp')
-rw-r--r--scene/resources/tile_set.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp
index 1c9db809ab..5a8c5b3782 100644
--- a/scene/resources/tile_set.cpp
+++ b/scene/resources/tile_set.cpp
@@ -3575,8 +3575,7 @@ Vector2i TileSetAtlasSource::get_tile_effective_texture_offset(Vector2i p_atlas_
margin = Vector2i(MAX(0, margin.x), MAX(0, margin.y));
Vector2i effective_texture_offset = Object::cast_to<TileData>(get_tile_data(p_atlas_coords, p_alternative_tile))->get_texture_offset();
if (ABS(effective_texture_offset.x) > margin.x || ABS(effective_texture_offset.y) > margin.y) {
- effective_texture_offset.x = CLAMP(effective_texture_offset.x, -margin.x, margin.x);
- effective_texture_offset.y = CLAMP(effective_texture_offset.y, -margin.y, margin.y);
+ effective_texture_offset = effective_texture_offset.clamp(-margin, margin);
}
return effective_texture_offset;