readium / readium-shared-js

Repository for the shared JavaScript libraries that are used in the SDK-Launchers and other applications developed on top of the SDK
BSD 3-Clause "New" or "Revised" License
78 stars 102 forks source link

In 2 pages mode, the second page may not show up entirely #37

Open danielweck opened 10 years ago

danielweck commented 10 years ago

Originally posted by @edas at https://github.com/readium/readium-js/issues/49

readium

See screenshot (in the right page : lack of a few characters on end of line, and lack of the blue right border of the "note"). Both reproduceable in Firefox and Chrome, both in master and in develop branches. This example is with the file "accessible epub 3" from readium-js-viewer.

When resizing little step per little step, it is easy to find a step where the second column is truncated of a few pixels.

In my example, here a few metrics :

The total (2 columns + gap) should fit in the iframe, but does not.

<p>in the columns have 353.5px (and not 353px) however there are more than 1 pixel missing at right so I doubt this rounding error is the root problem.

However, the <aside> surrounded by a blue border has 335.5px widht + 2_8px padding + 2_1px border. This may have to be investigated as a potential cause of the problem.

danielweck commented 10 years ago

I am able to reproduce this (Chrome OSX, Readium "cloud reader" and Chrome extension).

In my test case, each column is one pixel wider than it should be. This imprecision accumulates to several pixels by the time Readium "scrolls" to the correct column (HTML left relative positioning).

This is a browser issue, I am not sure how we can solve it. A possible workaround would be to assume a larger column width by default ("rounding up"), but this would have an adverse effect when scrolling to columns that have the correct size!

I also noticed that the "pre" code fragments are truncated as they overflow pass the column boundary. Again, I don't think we can do much to fix this, unless we stop using CSS columns to emulate pagination (which would be good, as there are other problems with columnization, such as unplayable videos in WebViews! Unfortunately, the "proper" W3C pagination feature isn't widely supported, and it has its own caveats anyway). I'm keeping this issue open, but with low priority.

danielweck commented 10 years ago

Ah, this seems to have fixed it (rounding error mitigation): https://github.com/readium/readium-shared-js/commit/da248db661d98871fd50fbca1800bf6326c9881e

As described in the comment above, the "pre" code fragments still overflow pass the column boundaries, but that is a no-fix.

jccr commented 9 years ago

I still notice this issue in the latest develop:

It appears the left side gets cut off now:

screen shot 2015-08-06 at 2 04 56 pm

This only happens if the viewport has an odd numbered width:

For example in my screenshot I'm using 1281x800 If I use 1280x800 or 1282x800 the issue doesn't appear..

jccr commented 9 years ago

One solution would be to always force the width we set to be even numbered.

jccr commented 9 years ago

This bug appears in pretty much any browser. I've seen it in iOS, OSX, Firefox, Chrome, Safari.

danielweck commented 9 years ago

Duplicate of https://github.com/readium/readium-shared-js/issues/181 ? If so, does https://github.com/readium/readium-shared-js/pull/200 fix this as well?