Skip to content

Commit

Permalink
Merge pull request #93255 from jsjtxietian/atlas-default
Browse files Browse the repository at this point in the history
Prevent generating preview for zero sized texture
  • Loading branch information
akien-mga committed Jun 18, 2024
2 parents 0fd5aad + 3027b49 commit 2a47014
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions editor/plugins/editor_preview_plugins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2a47014

Please sign in to comment.