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(components/ImagePreviewer): Prevent from negative top position #55

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

mingyc
Copy link

@mingyc mingyc commented May 19, 2019

Example Bug: https://i.imgur.com/8hJoZTD.png

The current returned top position calculated by (pageHeight - 20 -
height) can be negative, leading to part of the image rendered outside
the screen. This commit fixes it by verifying if the difference of
windows height & image height is valid before returning.

A better fix would be resizing the image whenever necessary, which is
out of the scope of this commit.

Example Bug: https://i.imgur.com/8hJoZTD.png

The current returned top position calculated by (pageHeight - 20 -
height) can be negative, leading to part of the image rendered outside
the screen. This commit fixes it by verifying if the difference of
windows height & image height is valid before returning.

A better fix would be resizing the image whenever necessary, which is
out of the scope of this commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant