Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix editor texture preview for certain specific dimensions #39638

Merged
merged 1 commit into from
Jun 18, 2020

Conversation

mrushyendra
Copy link
Contributor

@mrushyendra mrushyendra commented Jun 18, 2020

Currently, an error may be issued when showing a preview of a resource if
the associated image is resized to sub-1 pixel dimensions. This fix ensures no such error
is issued.

For example, when previewing a 256 x 1 PNG image:
Screenshot from 2020-06-18 16-50-53

After:
Screenshot from 2020-06-18 16-50-33

Figured that showing an image with 1-pixel width or height is better than not showing any
preview at all, though there may be a small distortion. p_size must also already be size 1x1 or
bigger, else a different error would be issued in the rendering_server, so this should be safe.

Closes #36940

(The same issue may also occur with the EditorImagePreviewPlugin, EditorBitmapPreviewPlugin and EditorMeshPreviewPlugin, though none seem to have been raised so far)

Edit: Turns out it would also close #35662

@akien-mga akien-mga added this to the 4.0 milestone Jun 18, 2020
@akien-mga akien-mga added the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Jun 18, 2020
Ensures no error is issued when attempting to preview a resource that
may be scaled down to <1 pixel when resizing to fit the thumbnail.
@akien-mga akien-mga merged commit 4e0f31a into godotengine:master Jun 18, 2020
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 3.2.2.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Jun 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants