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 border sizes around thumbnails #5596

Merged
merged 2 commits into from
Jan 23, 2015

Conversation

fkaelberer
Copy link
Contributor

This PR fixes two issues:

1. Thumbnail borders do not have the same width in all directions
Currently, the thumbnail border width is [7, 5, 6, 7]px in [top, right, bottom, left] direction. This is because the thumbnail canvas has a 1px border which is not accounted for in the size of the div element around it (which would explain a border size of [7, 5, 5, 7]px). The remaining pixel difference is because the size of the thumbnail canvas and its surrounding div is set as a fractional number, whose fractional part is ignored by the canvas element but respected by the div element. This PR ensures a 7px border width by taking the canvas border into account and setting an integer height to canvas and its surrounding div element.

2. Thumbnails jump up and down by a few pixels whenever a new thumbnail is loaded.
Thumbnails currently have a different size, depending on whether or not the "data-loaded" tag is set.
This PR adjust the CSS style of the not([data-loaded]) elements so that its size matches the other ones.
(The not([data-loaded]) elements have a 1px dashed border, whose size must be subtracted).

The second fix works perfectly for the tracemonkey paper, but images still move if pages have different aspect ratio. Nevertheless, there is much less movement than before.

@fkaelberer fkaelberer force-pushed the fixBordersAroundThumbnails branch 2 times, most recently from d95a366 to e30fae9 Compare December 29, 2014 20:35
@fkaelberer fkaelberer force-pushed the fixBordersAroundThumbnails branch from e30fae9 to 1d31018 Compare December 30, 2014 14:09
@fkaelberer
Copy link
Contributor Author

I split this PR into two commits, according to the two issues described above.

@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/fcdf454fba46d30/output.txt

timvandermeij added a commit that referenced this pull request Jan 23, 2015
@timvandermeij timvandermeij merged commit 997c2b9 into mozilla:master Jan 23, 2015
@timvandermeij
Copy link
Contributor

Thank you for the patches!

@fkaelberer fkaelberer deleted the fixBordersAroundThumbnails branch January 23, 2015 23:23
speedplane pushed a commit to speedplane/pdf.js that referenced this pull request Feb 24, 2015
…nails

Fix border sizes around thumbnails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants