Merge pull request #18464 from sersoong/master-fixstylebox

Fix stylebox crash
This commit is contained in:
Gilles Roudière 2018-04-27 15:26:42 +02:00 committed by GitHub
commit deee9f0cb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -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");