Add thumbnails to LargeTexture

This commit is contained in:
Timo Schwarzer
2019-01-03 13:08:06 +01:00
parent 200be0795d
commit 163e0e3ebd
3 changed files with 15 additions and 0 deletions

View File

@ -86,6 +86,7 @@ Ref<Texture> EditorTexturePreviewPlugin::generate(const RES &p_from, const Size2
Ref<Image> img;
Ref<AtlasTexture> atex = p_from;
Ref<LargeTexture> ltex = p_from;
if (atex.is_valid()) {
Ref<Texture> tex = atex->get_atlas();
if (!tex.is_valid()) {
@ -93,6 +94,8 @@ Ref<Texture> EditorTexturePreviewPlugin::generate(const RES &p_from, const Size2
}
Ref<Image> atlas = tex->get_data();
img = atlas->get_rect(atex->get_region());
} else if (ltex.is_valid()) {
img = ltex->to_image();
} else {
Ref<Texture> tex = p_from;
img = tex->get_data();