mirror of
https://github.com/stashapp/stash.git
synced 2026-04-22 06:52:39 +02: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:
parent
371a74d445
commit
8abb3c0d08
1 changed files with 2 additions and 2 deletions
|
|
@ -20,7 +20,7 @@ const HoverScrubber: React.FC<IHoverScrubber> = ({
|
|||
const { width } = e.currentTarget.getBoundingClientRect();
|
||||
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>) {
|
||||
|
|
@ -104,7 +104,7 @@ export const PreviewScrubber: React.FC<IScenePreviewProps> = ({
|
|||
const debounceSetActiveIndex = useDebounce(
|
||||
setActiveIndex,
|
||||
[setActiveIndex],
|
||||
10
|
||||
1
|
||||
);
|
||||
|
||||
const spriteInfo = useSpriteInfo(vttPath);
|
||||
|
|
|
|||
Loading…
Reference in a new issue