Skip to content

fix(components/ImagePreviewer): Prevent from negative top position#55

Open
mingyc wants to merge 1 commit into
robertabcd:devfrom
mingyc:dev
Open

fix(components/ImagePreviewer): Prevent from negative top position#55
mingyc wants to merge 1 commit into
robertabcd:devfrom
mingyc:dev

Conversation

@mingyc

@mingyc mingyc commented May 19, 2019

Copy link
Copy Markdown

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