readium / ts-toolkit

A toolkit for ebooks, audiobooks and comics written in Typescript
BSD 3-Clause "New" or "Revised" License
63 stars 10 forks source link

Virtual column for more than 2 displayed columns #61

Open JayPanoz opened 1 month ago

JayPanoz commented 1 month ago

Navigator-html-injectables has an helper that inserts a blank virtual column at the end of the resource to fix snapping and page turning issues caused by an odd number of columns when displaying two columns.

In ReadiumCSS version 2, the number of displayed columns is no longer constrained so the helper should take that into account and be updated.

For reference, the current function.

https://github.com/readium/ts-toolkit/blob/2a44a91b1339f7dbfe83c43ab838a6aebc4c8c4e/navigator-html-injectables/src/helpers/document.ts#L19-L43

Comments on anticipated challenges and issues, alternative ideas, etc. welcome. Now is probably the best time to revisit it.

chocolatkey commented 1 month ago

I want to note, this function is from the kotlin-toolkit:

https://github.com/readium/kotlin-toolkit/blob/develop/readium/navigator/src/main/assets/_scripts/src/utils.js#L32-L59

JayPanoz commented 1 month ago

That’s an important note. Thanks.

As @HadrienGardeur stated during the call yesterday, other toolkits may differ and not do more than 2 columns but I guess it would be a good idea to make sure everyone involved is aware of this issue and its developments, especially as it adds complexity to a tried and tested solution.

In theory adding as many virtual pages as needed depending on the number of columns should work, but there are possible side effects we’re not aware of yet.