diff options
author | Tomasz Chabora <kobewi4e@gmail.com> | 2019-09-17 19:26:20 +0200 |
---|---|---|
committer | Tomasz Chabora <kobewi4e@gmail.com> | 2019-09-17 19:26:20 +0200 |
commit | cf2ae78956c8ddc010062cf5eff38e40229a3665 (patch) | |
tree | 6a87e38b53e51f2382240fce672697144c33d4bc /editor/plugins | |
parent | 1399262ffac0c7f5011e653c4859bd60553c2419 (diff) |
Fix region editor for NinePatchRect
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/texture_region_editor_plugin.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index 4d349f06b7..21eebf9ca2 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -625,9 +625,12 @@ void TextureRegionEditor::_update_rect() { rect = node_sprite->get_region_rect(); else if (node_sprite_3d) rect = node_sprite_3d->get_region_rect(); - else if (node_ninepatch) + else if (node_ninepatch) { rect = node_ninepatch->get_region_rect(); - else if (obj_styleBox.is_valid()) + if (rect == Rect2()) { + rect = Rect2(Vector2(), node_ninepatch->get_texture()->get_size()); + } + } else if (obj_styleBox.is_valid()) rect = obj_styleBox->get_region_rect(); else if (atlas_tex.is_valid()) rect = atlas_tex->get_region(); |