diff options
| author | sersoong | 2018-04-27 17:22:42 +0800 |
|---|---|---|
| committer | sersoong | 2018-04-27 17:30:28 +0800 |
| commit | 21eac24af1b119f1e29e33b53bdb88a400de16c3 (patch) | |
| tree | 3dc1e7659460b4801b935367a02e1a82950ed98c | |
| parent | e5a13e26265179d9d6b477c6d744758521745123 (diff) | |
| download | godot-21eac24af1b119f1e29e33b53bdb88a400de16c3.tar.gz godot-21eac24af1b119f1e29e33b53bdb88a400de16c3.tar.zst godot-21eac24af1b119f1e29e33b53bdb88a400de16c3.zip | |
| -rw-r--r-- | scene/resources/style_box.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scene/resources/style_box.cpp b/scene/resources/style_box.cpp index 626fda50d..ad5a0fd9a 100644 --- a/scene/resources/style_box.cpp +++ b/scene/resources/style_box.cpp @@ -106,7 +106,11 @@ void StyleBoxTexture::set_texture(Ref<Texture> p_texture) { if (texture == p_texture) return; texture = p_texture; - region_rect = Rect2(Point2(), texture->get_size()); + if (p_texture.is_null()) { + region_rect = Rect2(0, 0, 0, 0); + } else { + region_rect = Rect2(Point2(), texture->get_size()); + } emit_signal("texture_changed"); emit_changed(); _change_notify("texture"); |
