Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: "Draw" cursor shouldn't revert back to normal after the first line #18932

Open
nicolo-ribaudo opened this issue Oct 21, 2024 · 3 comments
Labels

Comments

@nicolo-ribaudo
Copy link
Contributor

Attach (recommended) or Link to PDF file

any pdf

Web browser and its version

Firefox 131.0.3

Operating system and its version

macOS 14.6.1

PDF.js version

The one built-in in Firefox

Is the bug present in the latest PDF.js version?

Yes

Is a browser extension

No

Steps to reproduce the problem

  1. Open any PDF, such as just the default one at https://mozilla.github.io/pdf.js/web/viewer.html.
  2. Click on the "Draw" (Ink) annotation icon, to enable the tool
  3. Move the cursor on the PDF: it looks like a pencil
  4. Draw a line

Notice that after these step the drawing tool is still active (you can draw another line without having to re-select the tool).

What is the expected behavior?

After step 4, the cursor should still look like a pencil to indicate that the tool is still active and that you can still draw.

What went wrong?

After step 4, the cursor reverts back to the default "arrow".

Link to a viewer

No response

Additional context

Screen.Recording.2024-10-21.at.11.40.59.mov
@Snuffleupagus
Copy link
Collaborator

Interestingly, I cannot reproduce this on Windows 11.

@nicolo-ribaudo
Copy link
Contributor Author

After experimenting more with this, I noticed that if after drawing the first line you move the cursor out of the PDF page and then back in, it becomes again a pencil.

Also, I can only reproduce this problem in Firefox. In Chrome it works as expected, and in Safari it kinda works as expected bu the cursor quickly blinks between pencil and arrow while moving it.

@nicolo-ribaudo
Copy link
Contributor Author

And this is even weirder: if the window is narrow enough that I can move the cursor from the toolbar to the page without hovering outside of the page, then:

  • if I move the cursor left enough, it turns back from a pencil to the default
  • there is a point where it shows the "resize" cursor
  • moving back to the right doesn't turn the cursor back into a pencil
  • if I try to click where there is the "resize" cursor, it doesn't actually resize anything but it just draws (which is expected, since I have the ink tool enabled)
Screen.Recording.2024-10-21.at.12.19.31.mov

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

No branches or pull requests

3 participants