diff options
| author | Gilles Roudière | 2018-04-27 15:26:42 +0200 |
|---|---|---|
| committer | GitHub | 2018-04-27 15:26:42 +0200 |
| commit | deee9f0cb47e00645cf56340e34c78b21170977a (patch) | |
| tree | f27e9015c0f85b94439f2ecd75bdbb6f71c2d715 | |
| parent | b35f3a569e578c5ff7eb73257f84d74e30e361d1 (diff) | |
| parent | 21eac24af1b119f1e29e33b53bdb88a400de16c3 (diff) | |
| download | godot-deee9f0cb47e00645cf56340e34c78b21170977a.tar.gz godot-deee9f0cb47e00645cf56340e34c78b21170977a.tar.zst godot-deee9f0cb47e00645cf56340e34c78b21170977a.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"); |
