-
Notifications
You must be signed in to change notification settings - Fork 54
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 scroll to zoom, resize small images to fill #1063
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey! :)
Thanks for your PR.
I added some comments, please check them and feel free to ping me if you have any questions
@skjnldsv Can you please take a look at my replies (in particular the one about the hover background) Also I'm assuming the |
Yes :)
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
What the |
Setting the background to white is removed since it doesn't work well with the zooming (Outside the image boundaries is still transparent) Signed-off-by: ktprograms <[email protected]>
Add window resize event listener to check if image is filling width or height and then set either (width,max-height) or (height,max-width) such that small images are still resized to fill the view area. Signed-off-by: ktprograms <[email protected]>
@skjnldsv 70957b6 is because I set up Edit: 9407116 (turns out I didn't have |
Should I squash the handling of transparent images together with the fix zoom commit? Also, why are the built js files stored in the repo? It makes it so much harder to make git changes like fixups (that I then |
Signed-off-by: ktprograms <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so this is much better already.
I like it actually, nice approach. There is some regression though and this is the very reason position: absolute
was not being used in the first place.
Initially, we did NOT want to enlarge small pictures. Which currently, it is done by that PR. This is the only regression found when testing all the use cases I have with images sized 👍
Here is the list of other regressions:
- Small pictures are enlarged
- Arrows are over the pictures
- Title is over the picture (bright image will hide the title)
@jancborchardt @nimishavijay needs to validate this before we merge!
I'm personally ok with that if we don't put the image under the title.
Setting the background to white is removed since it doesn't work well with the zooming (Outside the image boundaries is still transparent).
Transitions are disabled when zooming (or rather only enabled when zooming back to 1x or in to 1.3x) because they don't work well with zooming (feels laggy).