Skip to content
This repository has been archived by the owner on Sep 22, 2020. It is now read-only.

strange cursor behavior #469

Open
eLiNK2gl opened this issue Oct 19, 2012 · 5 comments
Open

strange cursor behavior #469

eLiNK2gl opened this issue Oct 19, 2012 · 5 comments
Labels

Comments

@eLiNK2gl
Copy link

following observations in the highlighting mode (press 'N')

  1. in some cases, some parts of text are not accessible. E.g. while in 'A' mode I can highlight every line on a page. In a Shift + 'A' mode some lines are not accessible and by moving the cursor down (five way) one jumps to the next page
  2. with some texts (noticed on a page with three columns) while moving cursor down you can select every line but as soon as you try to select the previous lines the cursor jumps somewhere at the beginning of the page.
@houqp
Copy link
Member

houqp commented Oct 20, 2012

So far highlight indeed is not supported in other modes except fit to content width mode. If it happened to work in other mode, then it's just lucky... But the second one should be a bug. I am sorry that the highlight code is so badly written that I don't even have the faith to fix it ;p I am considering rewrite it in the new ui code base...

@dpavlin
Copy link
Member

dpavlin commented Oct 20, 2012

@houqp highlight should work in all zoom modes, because I did some work on coordinate transformation for links, so at least coordinates on screen should be sane.

Having said that, I did notice that some pdf files do have strange order of lines when moving on page, but I assumed that this is partially a fault of pdf layout.

@tigran123
Copy link
Member

@dpavlin I know that in some PDF files you cannot correctly go from one word to the next because the kind of space used in between them (as you know there are about 40 kinds of "space" characters) is not recognized as space, i.e. moving to the right would skip a whole sentence or some such block. This is, btw, precisely the reason why instant dictionary lookup does not work reliably in PDF files, namely positioning the cursor on the word "matter" in the sentence "The matter of this item" looks up a non-existent word "Thematterofthisitem" which fails. This is easy to see by selecting the whole sentence and pressing Space (in Amazon's PDF reader, not KPV) to copy it to the buffer --- you see the sentence compacted into a single word, i.e. all spaces removed. But on some other PDF files the space is "the right kind" and instant dictionary lookup works. I noticed that your highlight movement (in KPV) also behaves like this, i.e. don't notice the space if it is of the first kind described above.

@houqp
Copy link
Member

houqp commented Oct 21, 2012

yeah, there are many pdfs that have wrong line/word coordinates. :(

But for the wired behavior like KPV jumps to the next page automatically should be a bug in our highlight feature. The native system does not support auto page turn when doing highlight, so if the line cross screen view, user have to manually press pagedown. That's a lot simpler to implement, but for some reasons, I decided that when moving cursor in highlight mode, KPV should be clever enough to do pageturn automatically. Now it turns out that it is still not clever enough, because it turns too much page ;p

@eLiNK2gl
Copy link
Author

neither does it work in the fit to content width mode (Shift + S).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants