From 3027b499433b6be49a64fcf13dcfd26fb887f381 Mon Sep 17 00:00:00 2001 From: jsjtxietian Date: Tue, 18 Jun 2024 12:09:15 +0800 Subject: [PATCH] Prevent generating preview for zero sized texture --- editor/plugins/editor_preview_plugins.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp index f2b38536b5c..7ac924571d3 100644 --- a/editor/plugins/editor_preview_plugins.cpp +++ b/editor/plugins/editor_preview_plugins.cpp @@ -97,6 +97,10 @@ Ref EditorTexturePreviewPlugin::generate(const Ref &p_from, return Ref(); } + if (!atex->get_region().has_area()) { + return Ref(); + } + img = atlas->get_region(atex->get_region()); } else { Ref tex = p_from;