aboutsummaryrefslogtreecommitdiff
path: root/editor/plugins/texture_editor_plugin.cpp
diff options
context:
space:
mode:
authorRobert Hernandez2017-03-29 19:30:24 -0400
committerRobert Hernandez2017-06-29 10:49:24 -0400
commitf0f407e76eafdfe76b9439c7e527f085a6ff22d9 (patch)
treebcf8b3ecb7df8cee85de7a0611688cd14cafd1ab /editor/plugins/texture_editor_plugin.cpp
parent198bd9db02950d261c83b0c383fe737df3c5f152 (diff)
downloadgodot-f0f407e76eafdfe76b9439c7e527f085a6ff22d9.tar.gz
godot-f0f407e76eafdfe76b9439c7e527f085a6ff22d9.tar.zst
godot-f0f407e76eafdfe76b9439c7e527f085a6ff22d9.zip
Diffstat (limited to 'editor/plugins/texture_editor_plugin.cpp')
-rw-r--r--editor/plugins/texture_editor_plugin.cpp16
1 files changed, 13 insertions, 3 deletions
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<Texture> 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();
}
}