-
Notifications
You must be signed in to change notification settings - Fork 373
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 failing to preview small images #3520
Conversation
0100ab4
to
7ece3b0
Compare
I think stretching to at least on ui point wide/high makes perfect sense, and much better than cropping. You want to see this thin gradients, or whatever they are. |
for gradients it's the obvious thing, but we may also run into this with images that aren't gradient, they just happen to haven an awful aspect ratio |
🤔 but maybe stretching to the min size might be the better call. After all the min size is still tiny, you won't notice that it's stretched no matter the content |
okay let's try that instead. should be simpler code as well :/ |
updated screenshots with stretching behavior. much nicer |
cargo deny failure is a known issue |
What
Changed the way we deal with image previews. They now occupy always the requested size (previously, they'd expand to a max size) and the image displayed within may be stretched in rare situations.
Fixed-sized-ness of the preview image is an improvement in thus far as I think as it makes ui layouting a bit easier and more predictable, but I had to add a flag to not do so on hovering the preview since we would have a lot of empty space there otherwise.
Test code:
Before with hovering the preview:
horizontal:
vertical:
car:
After with hovering the preview:
horizontal:
vertical:
car:
I originally also wanted to tackle increasing the default zoom in the viewport. Had some initial success but found getting the zoom state correctly set in all situations too fiddely, so gave up on this for now. This aspect will be need to be re-visited anyways when we drop the scroll bars as long planned.
Checklist