You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
open any pdf and start selecting some text.
Until you are directly over text while dragging your mouse, the selection will have proper starting and ending. As soon as you move over some empty space , say space between two paragraphs that you want to select, the selection's end point will shift to the start of the page.
My hunch is that when you are not over any text, and you convert the mouse coordinates to text offset, it returns -1, so the selection end goes to offset -1, or 0, that is the start of the page. If this is the issue, we should probably fallback to the previously used selection end offset in such cases.
The text was updated successfully, but these errors were encountered:
Are you sure this is not just a browser issue? So I am not sure if anybody is converting any coordinates to selection or anything in pdf.js code. It is how browser allows text selection on hidden text divs layered over the canvas in pdf.js. And the issue is that divs are positioned only over the text, so when you get with the mouse out of the text area, browser doesn't follow anymore what you are selecting.
We tried a very simple hack: for all text layer divs we added 100px right and bottom padding. And it works much better then.
open any pdf and start selecting some text.
Until you are directly over text while dragging your mouse, the selection will have proper starting and ending. As soon as you move over some empty space , say space between two paragraphs that you want to select, the selection's end point will shift to the start of the page.
My hunch is that when you are not over any text, and you convert the mouse coordinates to text offset, it returns -1, so the selection end goes to offset -1, or 0, that is the start of the page. If this is the issue, we should probably fallback to the previously used selection end offset in such cases.
The text was updated successfully, but these errors were encountered: