mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 12:54:38 +03:00
Fix thumbnail scrubber crash (#4063)
* Fix scrubber crash when cursor on right-most pixel * Minimise debounce for smoother scrubbing
This commit is contained in:
@@ -20,7 +20,7 @@ const HoverScrubber: React.FC<IHoverScrubber> = ({
|
|||||||
const { width } = e.currentTarget.getBoundingClientRect();
|
const { width } = e.currentTarget.getBoundingClientRect();
|
||||||
const x = e.nativeEvent.offsetX;
|
const x = e.nativeEvent.offsetX;
|
||||||
|
|
||||||
return Math.floor((x / width) * totalSprites);
|
return Math.floor((x / width) * (totalSprites - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
function onMouseMove(e: React.MouseEvent<HTMLDivElement, MouseEvent>) {
|
function onMouseMove(e: React.MouseEvent<HTMLDivElement, MouseEvent>) {
|
||||||
@@ -104,7 +104,7 @@ export const PreviewScrubber: React.FC<IScenePreviewProps> = ({
|
|||||||
const debounceSetActiveIndex = useDebounce(
|
const debounceSetActiveIndex = useDebounce(
|
||||||
setActiveIndex,
|
setActiveIndex,
|
||||||
[setActiveIndex],
|
[setActiveIndex],
|
||||||
10
|
1
|
||||||
);
|
);
|
||||||
|
|
||||||
const spriteInfo = useSpriteInfo(vttPath);
|
const spriteInfo = useSpriteInfo(vttPath);
|
||||||
|
|||||||
Reference in New Issue
Block a user