1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-12 13:20:55 +00:00

Replace Rect2(i) has_no_area with has_area

This commit is contained in:
Aaron Franke
2022-08-14 21:51:45 -05:00
parent 817ae95667
commit 995b9f94e8
12 changed files with 44 additions and 46 deletions

View File

@@ -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;
}