summaryrefslogtreecommitdiffstats
path: root/scene/gui/texture_rect.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-07-01 22:54:27 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-07-01 22:54:27 +0200
commit9425535602a526a1b021838a7d021a5d75a62574 (patch)
treecc97aae7bbb1d881bc778975ab2c29034bb3e649 /scene/gui/texture_rect.cpp
parent070dddf9cae36e4cadffadcca66b81fef66f171b (diff)
parent88b29539f7f316aa8ffeb8232e2971a594dc159c (diff)
downloadredot-engine-9425535602a526a1b021838a7d021a5d75a62574.tar.gz
Merge pull request #93828 from kleonc/atlas-texture-fix-draw-rect-flipping
Fix `AtlasTexture::draw_rect` flipping for non-zero margin
Diffstat (limited to 'scene/gui/texture_rect.cpp')
-rw-r--r--scene/gui/texture_rect.cpp10
1 files changed, 0 insertions, 10 deletions
diff --git a/scene/gui/texture_rect.cpp b/scene/gui/texture_rect.cpp
index c52f463905..972a832985 100644
--- a/scene/gui/texture_rect.cpp
+++ b/scene/gui/texture_rect.cpp
@@ -30,7 +30,6 @@
#include "texture_rect.h"
-#include "scene/resources/atlas_texture.h"
#include "servers/rendering_server.h"
void TextureRect::_notification(int p_what) {
@@ -92,15 +91,6 @@ void TextureRect::_notification(int p_what) {
} break;
}
- Ref<AtlasTexture> p_atlas = texture;
-
- if (p_atlas.is_valid() && !region.has_area()) {
- Size2 scale_size(size.width / texture->get_width(), size.height / texture->get_height());
-
- offset.width += hflip ? p_atlas->get_margin().get_position().width * scale_size.width * 2 : 0;
- offset.height += vflip ? p_atlas->get_margin().get_position().height * scale_size.height * 2 : 0;
- }
-
size.width *= hflip ? -1.0f : 1.0f;
size.height *= vflip ? -1.0f : 1.0f;