mirror of
https://github.com/stashapp/stash.git
synced 2025-12-08 01:13:09 +01:00
Ignore mousemove when just clicking (#4302)
This commit is contained in:
parent
b0a34a3dc0
commit
13a24a634d
1 changed files with 9 additions and 3 deletions
|
|
@ -220,15 +220,21 @@ export const ScenePlayerScrubber: React.FC<IScenePlayerScrubberProps> = ({
|
||||||
(event: MouseEvent) => {
|
(event: MouseEvent) => {
|
||||||
if (!mouseDown.current) return;
|
if (!mouseDown.current) return;
|
||||||
|
|
||||||
|
// negative dragging right (past), positive left (future)
|
||||||
|
const delta = event.clientX - lastMouseEvent.current!.clientX;
|
||||||
|
|
||||||
if (lastMouseEvent.current === startMouseEvent.current) {
|
if (lastMouseEvent.current === startMouseEvent.current) {
|
||||||
|
// this is the first mousemove event after mousedown
|
||||||
|
|
||||||
|
// #4295: a mousemove with delta 0 can be sent when just clicking
|
||||||
|
// ignore such an event to prevent pausing the player
|
||||||
|
if (delta === 0) return;
|
||||||
|
|
||||||
onScroll();
|
onScroll();
|
||||||
}
|
}
|
||||||
|
|
||||||
contentEl.current!.classList.add("dragging");
|
contentEl.current!.classList.add("dragging");
|
||||||
|
|
||||||
// negative dragging right (past), positive left (future)
|
|
||||||
const delta = event.clientX - lastMouseEvent.current!.clientX;
|
|
||||||
|
|
||||||
const movement = event.movementX;
|
const movement = event.movementX;
|
||||||
velocity.current = movement;
|
velocity.current = movement;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue