Skip to content

Fix for img padding #22

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

Merged
merged 1 commit into from
Oct 4, 2016
Merged

Fix for img padding #22

merged 1 commit into from
Oct 4, 2016

Conversation

DRSDavidSoft
Copy link
Contributor

If the img has any padding, they should be considered as well. Otherwise the magnifying lense is displayed incorrectly.
This is required, in some cases img tags are used with box-sizing set to border-box and padding added, which reduces the total size of which an image is displayed.

Using jQuery's innerWidth and innerHeight instead of width and height has no effect if the img has no padding, but it fixed the mentioned problems if img has padding.

If the *img* has any *padding*, they should be considered as well. Otherwise the magnifying lense is displayed incorrectly.
This is required, in some cases *img* tags are used with *box-sizing* set to *border-box* and padding added, which reduces the total size of which an image is displayed.

Using jQuery's *innerWidth* and *innerHeight* instead of *width* and *height* has no effect if the *img* has no padding, but it fixed the mentioned problems if *img* has *padding*.
thdoan pushed a commit that referenced this pull request Oct 4, 2016
Copy link
Owner

@thdoan thdoan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks for the PR.

@thdoan thdoan merged commit 24202a0 into thdoan:master Oct 4, 2016
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.

2 participants