diff options
author | Anilforextra <anilforextra@gmail.com> | 2021-09-29 09:36:34 +0545 |
---|---|---|
committer | Anilforextra <anilforextra@gmail.com> | 2021-09-29 09:36:34 +0545 |
commit | fc9767abb14348c2236b487f0bc6d18de65a38fd (patch) | |
tree | ef480b9a349b88a51b75296eae844c27a2504469 /scene/resources/tile_set.cpp | |
parent | 5aa099aaed359df6ff79fe31616b5601db2a42c5 (diff) | |
download | redot-engine-fc9767abb14348c2236b487f0bc6d18de65a38fd.tar.gz |
Use functions defined in the their classes.
Diffstat (limited to 'scene/resources/tile_set.cpp')
-rw-r--r-- | scene/resources/tile_set.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp index 67cbd0e094..2dd6fabb33 100644 --- a/scene/resources/tile_set.cpp +++ b/scene/resources/tile_set.cpp @@ -3558,8 +3558,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; |