-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix LVDocView::getBookmark() which could be slow or wrong (#313)
Since 5967f72 and some change to be able to traverse RTL tables for text selection, LVDocView::getBookmark(), which is used to get the current page xpointer, could be slow on some pages, or wrong on others. So, make it clear that, with createXPointer(lvPoint, direction) and elementFromPoint(lvPoint, direction), using direction=0 will check for x, while direction=1/-1 will not. Wherever we are only interested in y, and provide a dummy x=0, we should use direction=1 or -1: - getPageDocumentRange() was already using 1/-1 exclusively. - getBookmark() now does too. - getNodeByPoint() uses 0 to find the exact node at x/y. - (Others LVDocView methods have not been updated nor checked, as they are not used by KOReader).
- Loading branch information
Showing
2 changed files
with
34 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters