Fix pixelized previews, but also instances of breaking ImageTexture cache. Closes #25378.

This commit is contained in:
Juan Linietsky 2019-01-27 13:39:16 -03:00
parent b494de34aa
commit a089061120
5 changed files with 13 additions and 1 deletions

View file

@ -99,12 +99,14 @@ Ref<Texture> EditorTexturePreviewPlugin::generate(const RES &p_from, const Size2
} else {
Ref<Texture> tex = p_from;
img = tex->get_data();
if (img.is_valid()) {
img = img->duplicate();
}
}
if (img.is_null() || img->empty())
return Ref<Texture>();
img = img->duplicate();
img->clear_mipmaps();
if (img->is_compressed()) {