View Single Post
Old 06-12-2021, 02:27 PM   #53
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,831
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by KevinH View Post
I think the bug here in 2 page spread mode is that the columnWidth already accounts for the gap between columns (pages) and so only the leftPadding should be used in calculating max-width on left hand side pages while rightPadding alone should be used in calculating max-width of right hand side pages but that routine does not seem to know which side of the two page spread is being used.

But this is just a guess. I would need to run your test case in a browser with the reader software and check out the values of the padding via the java console to try to really understand what is going on here.

That said perhaps adding back in the gap to the columnWidth in the calculation will make it work correctly without the need to zero it out.
I tell you that I applied your first patch:

Code:
if (this._layout.divisor > 1) {
   horizontalPadding = 0;
}
and EpubJS showed correctly the images at one and two columns, even with float images. So it seems that after zeroing horizontalPadding in two columns layout, images are displayed fine.

But I also applied your second patch, and it worked flawlessly! No more issues when the ereader is displaying images at one or two columns, even with floating images. You did it You found and fixed the bug. What a great work!! Thank you very much Kevin. I think that in new versions of your plugin, you can safely include your patch in epub.js.

EDIT: I forgot to tell you that with your second patch, you even improved the separation (the gap) between the two columns in the full window layout. So, your second patch is the full solution for the bug.

Last edited by RbnJrg; 06-12-2021 at 02:33 PM.
RbnJrg is offline   Reply With Quote