Comments (5)
Updated EPUBJS.Renderer.prototype.isElementVisible
Thanks!
from epub.js.
I'm sorry, but after running some tests, also the solution suggested above is not working.
With left <= width, if we have a page with an element that ends exactly at the end of the page/column, the first visible becomes the fist in the next page....
The problem occurs within an iPhone screen: it seems with small page (spreadWith) width it fails to catch the right first visible element. I'm looking for some other solutions.
(Thanks for your work)
from epub.js.
Hi,
I've noticed the same issue on some books rendered on small screens.
The issue is reproductible with a google chrome browser with reduced size of div where epubjs renders a book.
I've found that CFI attached to the pageMap of chapter contains incorrect endOffset value in case of callapsed paragraph/span. The CFI points to the last word on previous page, so finally the function generateRangeFromCfi() generates range that left position is smaller than pageSize. Function getPageNumberByRect() called by gotoCfi() with range returned from generateRangeFromCfi() using extra function Math.floor() designates incorrect page number (it points to the previous one).
I'm not able to provide the best solution but I think that the process of generating page CFI should be fixed - it should return offset from the first word on the next page, not offset of the last word on previous page as is now.
from epub.js.
Hi,
I've deeper investigated the issue and I've already got a simple solution. The issue was related to bad working CFI generator mechanism for DOM element. It uses string.indexOf method to split text into words by space character. As there could be other characters that can break the line, they should be proprly handled.
You can find fix in my forked branch, commit 287cbcd.
from epub.js.
Fix is now in master, thanks again @bielskij
from epub.js.
Related Issues (20)
- How to get xpath in epubjs ? HOT 10
- epubjs cfirange HOT 1
- page-break-after: always not honored HOT 2
- Add function script before render HOT 2
- Shift right when selection text HOT 3
- Bug: When package manifest and toc are in different folders, navigation does not work.
- Unable to read renderless.html file when i change the url to my book HOT 2
- Is `ignoreClass` value within the examples outdated? HOT 1
- What happened to the official website? The content is very strange. HOT 2
- Continuous Manager inside an element that is scrolling that is not the viewport?
- Scripted Content SandBoxing issue, And CFI pages position
- Extracting the text per rendered section / block using epub js? HOT 32
- How do I add a paginated swipe animation?
- highlight not working post integrating with hammer.js for swiping HOT 1
- how to call images in css file? HOT 1
- about rendition.next(), rendition.prev()
- about InlineView
- Minified XML causes 'container.xml not found' HOT 4
- renderTo CSS selector instead of ID HOT 1
- [Bug] Blank page when resize happen during loading
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from epub.js.