From f7c144a180bce8e5db5e8c154aa8b7a5cf26d58d Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Wed, 6 Jul 2022 13:57:03 +0800 Subject: [PATCH] Update TextureRegion editor when NinePatchRect/StyleBoxTexture changes Updates the editor when the region rect or margins change. --- editor/plugins/texture_region_editor_plugin.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index 8340d303c21..371eb150a4b 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -925,6 +925,12 @@ void TextureRegionEditor::_changed_callback(Object *p_changed, const char *p_pro if (p_prop == StringName("atlas") || p_prop == StringName("texture") || p_prop == StringName("region")) { _edit_region(); } + if (Object::cast_to(p_changed) && (p_prop == StringName("region_rect") || p_prop == StringName("patch_margin_left") || p_prop == StringName("patch_margin_right") || p_prop == StringName("patch_margin_top") || p_prop == StringName("patch_margin_bottom"))) { + _edit_region(); + } + if (Object::cast_to(p_changed) && (p_prop == StringName("content_margin_left") || p_prop == StringName("content_margin_right") || p_prop == StringName("content_margin_top") || p_prop == StringName("content_margin_bottom"))) { + _edit_region(); + } } void TextureRegionEditor::_edit_region() {