Prevent generating preview for zero sized texture
This commit is contained in:
parent
475248d99d
commit
3027b49943
1 changed files with 4 additions and 0 deletions
|
@ -97,6 +97,10 @@ Ref<Texture2D> EditorTexturePreviewPlugin::generate(const Ref<Resource> &p_from,
|
||||||
return Ref<Texture2D>();
|
return Ref<Texture2D>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!atex->get_region().has_area()) {
|
||||||
|
return Ref<Texture2D>();
|
||||||
|
}
|
||||||
|
|
||||||
img = atlas->get_region(atex->get_region());
|
img = atlas->get_region(atex->get_region());
|
||||||
} else {
|
} else {
|
||||||
Ref<Texture2D> tex = p_from;
|
Ref<Texture2D> tex = p_from;
|
||||||
|
|
Loading…
Reference in a new issue