瀏覽代碼

Adds automatic update for region_rect

When changing the texture region for a StyleBox, the regions was not updating automatically in the Texture editor.

(cherry picked from commit 7d7727badeb22f838e15ef9a87e644e79199fc0b)
Zak 6 年之前
父節點
當前提交
d94323e37b
共有 2 個文件被更改,包括 2 次插入1 次删除
  1. 1 1
      editor/plugins/texture_region_editor_plugin.cpp
  2. 1 0
      scene/resources/style_box.cpp

+ 1 - 1
editor/plugins/texture_region_editor_plugin.cpp

@@ -858,7 +858,7 @@ void TextureRegionEditor::_changed_callback(Object *p_changed, const char *p_pro
 
 	if (!is_visible())
 		return;
-	if (p_prop == StringName("atlas") || p_prop == StringName("texture"))
+	if (p_prop == StringName("atlas") || p_prop == StringName("texture") || p_prop == StringName("region"))
 		_edit_region();
 }
 

+ 1 - 0
scene/resources/style_box.cpp

@@ -259,6 +259,7 @@ void StyleBoxTexture::set_region_rect(const Rect2 &p_region_rect) {
 
 	region_rect = p_region_rect;
 	emit_changed();
+	_change_notify("region");
 }
 
 Rect2 StyleBoxTexture::get_region_rect() const {