Merge pull request #62766 from timothyqiu/texture-region-callback

[3.x] Update TextureRegion editor when NinePatchRect/StyleBoxTexture changes
This commit is contained in:
Rémi Verschelde 2022-07-06 08:38:21 +02:00 committed by GitHub
commit 7d8adb2dc5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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<NinePatchRect>(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<StyleBoxTexture>(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() {