Prevent generating preview for zero sized texture

This commit is contained in:
jsjtxietian 2024-06-18 12:09:15 +08:00
parent 475248d99d
commit 3027b49943
1 changed files with 4 additions and 0 deletions

View File

@ -97,6 +97,10 @@ Ref<Texture2D> EditorTexturePreviewPlugin::generate(const Ref<Resource> &p_from,
return Ref<Texture2D>();
}
if (!atex->get_region().has_area()) {
return Ref<Texture2D>();
}
img = atlas->get_region(atex->get_region());
} else {
Ref<Texture2D> tex = p_from;