mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +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 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);
|
||||
|
||||
Reference in New Issue
Block a user