GraphiteEditor / GraphiteEditor/Graphite

JS debugging: dragging the increment mode number field sometimes jumps at the start

Aperta
#2,807 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Good First Issue Help Wanted Paper Cut Web
Lingua principale
Rust
Stelle
27.2k
Fork
1.3k
Merge medio
20h 5m
PR unite (30g)
57

Descrizione

This seems to probably happen more commonly in Chrome, and it seems to be harder to reproduce in Firefox (I wasn't able to reproduce it in FF in my testing right now, @0HyperCube mentions in the comments below that he has encountered it in FF). See `NumberInput.svelte`.

When you click and drag a number input field of the increment (not range) style, meaning the kind you can drag infinitely left or right, it will sometimes teleport the value to a wildly different value from the one it started with. This can be reproduced by drawing a rectangle and dragging left and right on its stroke weight parameter in the Properties panel repeatedly in quick, small left and right drags until occasionally it will make a big jump.

I hypothesize this is caused by weirdness in the event ordering and mouse position reporting with the [pointer lock](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API) API, and it might be related to the widget being broken in Safari: #2038. I recommend logging the values that are being reported by the API and current state every frame to narrow down when the events occur and produce the discrepancy.

At the 4-second mark in this video, we see it jump from `131.3` to `17.3` immediately when the click-and-drag begins:

https://github.com/user-attachments/assets/61b1b1e6-4560-4555-aac5-f7b54cbfacb9

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.