diff options
author | Aaron Franke <arnfranke@yahoo.com> | 2022-08-14 21:51:45 -0500 |
---|---|---|
committer | Aaron Franke <arnfranke@yahoo.com> | 2022-09-04 23:03:36 -0500 |
commit | 995b9f94e8378b3e1dd81068925e9d34c68445c6 (patch) | |
tree | 673315b285de37ae0d1e361614a5e59641abd9ae /scene/gui/texture_rect.cpp | |
parent | 817ae9566723fd28be9dc5bb199001dc50ca6b54 (diff) | |
download | redot-engine-995b9f94e8378b3e1dd81068925e9d34c68445c6.tar.gz |
Replace Rect2(i) has_no_area with has_area
Diffstat (limited to 'scene/gui/texture_rect.cpp')
-rw-r--r-- | scene/gui/texture_rect.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scene/gui/texture_rect.cpp b/scene/gui/texture_rect.cpp index da53da20b0..459e67091d 100644 --- a/scene/gui/texture_rect.cpp +++ b/scene/gui/texture_rect.cpp @@ -94,7 +94,7 @@ void TextureRect::_notification(int p_what) { Ref<AtlasTexture> p_atlas = texture; - if (p_atlas.is_valid() && region.has_no_area()) { + 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; @@ -104,10 +104,10 @@ void TextureRect::_notification(int p_what) { size.width *= hflip ? -1.0f : 1.0f; size.height *= vflip ? -1.0f : 1.0f; - if (region.has_no_area()) { - draw_texture_rect(texture, Rect2(offset, size), tile); - } else { + if (region.has_area()) { draw_texture_rect_region(texture, Rect2(offset, size), region); + } else { + draw_texture_rect(texture, Rect2(offset, size), tile); } } break; } |