Skip to content

Commit

Permalink
Merge pull request #39638 from mrushyendra/editor_preview
Browse files Browse the repository at this point in the history
Fix editor texture preview for certain specific dimensions
  • Loading branch information
akien-mga authored Jun 18, 2020
2 parents dfa5f88 + c7a8dc7 commit 4e0f31a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion editor/plugins/editor_preview_plugins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ Ref<Texture2D> EditorTexturePreviewPlugin::generate(const RES &p_from, const Siz
if (new_size.y > p_size.y) {
new_size = Vector2(new_size.x * p_size.y / new_size.y, p_size.y);
}
img->resize(new_size.x, new_size.y, Image::INTERPOLATE_CUBIC);
Vector2i new_size_i(MAX(1, (int)new_size.x), MAX(1, (int)new_size.y));
img->resize(new_size_i.x, new_size_i.y, Image::INTERPOLATE_CUBIC);

post_process_preview(img);

Expand Down

0 comments on commit 4e0f31a

Please sign in to comment.