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

Drawing is broken for zoomed-in images in Firefox #6490

Open
eatyourgreens opened this issue Nov 23, 2024 · 4 comments · May be fixed by #6491
Open

Drawing is broken for zoomed-in images in Firefox #6490

eatyourgreens opened this issue Nov 23, 2024 · 4 comments · May be fixed by #6491
Labels
bug Something isn't working

Comments

@eatyourgreens
Copy link
Contributor

eatyourgreens commented Nov 23, 2024

Package

Examples

  • lib-classifier

Describe the bug

Dragging a drawn mark, in Firefox, doesn't correctly map the cursor position to the enlarged SVG image. It looks like the cursor position is mapped to the original (not zoomed-in) viewport.

Screen.Recording.2024-11-23.at.17.16.58.mov

To Reproduce

https://frontend.preview.zooniverse.org/projects/eatyourgreens/-project-testing-ground/classify/workflow/3370?env=staging

In Firefox, zoom in, place a point mark, then drag the point to a new position.

Alternatively, zoom in, draw a line, then drag one of the end points to a new position.

Expected behavior

Drawing works as expected in Chrome and Safari. The dragged element should follow the pointer position.

Additional context

Dragging interactions get the current transformation matrix from a svg element stored in SVGContext here:

Creating a mark here gets the CTM from the DrawingCanvas component in the InteractionLayer component.

I don't think those are referencing the same DOM node, so that could account for differences in behaviour between creating a mark and dragging a mark. They probably should be using the same DOM node and transformation matrix.

@eatyourgreens
Copy link
Contributor Author

This bug means that Etch-A-Cell must be almost impossible in Firefox. 😳

@eatyourgreens
Copy link
Contributor Author

Updating the context so that all transformations reference the same SVG rect element fixes this.

@eatyourgreens
Copy link
Contributor Author

Here's a screen recording from Etch-A-Cell, showing this bug in Firefox when you edit a line.

https://www.zooniverse.org/projects/willcharlie/etch-a-cell-correct-a-cell/classify/workflow/24998/subject/93925784

Screen.Recording.2024-11-24.at.11.20.13.mov

@eatyourgreens
Copy link
Contributor Author

eatyourgreens commented Nov 24, 2024

You can also reproduce this bug on any transcription project in Firefox.

https://www.zooniverse.org/projects/printmigrationnetwork/print/classify/workflow/20199/subject-set/120739/subject/99370214

Screen.Recording.2024-11-25.at.09.14.26.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant