From f0f407e76eafdfe76b9439c7e527f085a6ff22d9 Mon Sep 17 00:00:00 2001 From: Robert Hernandez Date: Wed, 29 Mar 2017 19:30:24 -0400 Subject: Texture region now updates when changing an Atlas - Removed atlas_changed signal for AtlasTexture - Changes are now handled by _notify_change - Removed unneccesary signal connections - Texture preview now updates in real-time Fixed TextureRegionEditor constantly regenerating --- editor/plugins/texture_editor_plugin.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'editor/plugins/texture_editor_plugin.cpp') diff --git a/editor/plugins/texture_editor_plugin.cpp b/editor/plugins/texture_editor_plugin.cpp index c4fe15e61..df71ea99c 100644 --- a/editor/plugins/texture_editor_plugin.cpp +++ b/editor/plugins/texture_editor_plugin.cpp @@ -102,14 +102,24 @@ void TextureEditor::_notification(int p_what) { } } +void TextureEditor::_changed_callback(Object *p_changed, const char *p_prop) { + + if (!is_visible()) + return; + update(); +} + void TextureEditor::edit(Ref p_texture) { + if (!texture.is_null()) + texture->remove_change_receptor(this); + texture = p_texture; - if (!texture.is_null()) + if (!texture.is_null()) { + texture->add_change_receptor(this); update(); - else { - + } else { hide(); } } -- cgit v1.2.3-70-g09d2