mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-14 10:34:06 +02:00
Remove duplicate isPanning state (#6086)
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
3d17f0409f
commit
d53beb9bce
@@ -35,7 +35,7 @@ export function useViewerRightRailButtons(isRulerActive?: boolean, setIsRulerAct
|
|||||||
isSearchInterfaceVisible,
|
isSearchInterfaceVisible,
|
||||||
registerImmediatePanUpdate,
|
registerImmediatePanUpdate,
|
||||||
} = viewer;
|
} = viewer;
|
||||||
const [isPanning, setIsPanning] = useState<boolean>(() => viewer.getPanState()?.isPanning ?? false);
|
const [isPanning, setIsPanning] = useState<boolean>(false);
|
||||||
const { sidebarRefs } = useSidebarContext();
|
const { sidebarRefs } = useSidebarContext();
|
||||||
const { position: tooltipPosition } = useRightRailTooltipSide(sidebarRefs, 12);
|
const { position: tooltipPosition } = useRightRailTooltipSide(sidebarRefs, 12);
|
||||||
const { handleToolSelect, handleToolSelectForced, handleBackToTools } = useToolWorkflow();
|
const { handleToolSelect, handleToolSelectForced, handleBackToTools } = useToolWorkflow();
|
||||||
@@ -194,9 +194,8 @@ export function useViewerRightRailButtons(isRulerActive?: boolean, setIsRulerAct
|
|||||||
onClick: () => {
|
onClick: () => {
|
||||||
const next = !isRulerActive;
|
const next = !isRulerActive;
|
||||||
setIsRulerActive?.(next);
|
setIsRulerActive?.(next);
|
||||||
if (next && viewer.getPanState()?.isPanning) {
|
if (next && isPanning) {
|
||||||
viewer.panActions.togglePan();
|
viewer.panActions.disablePan();
|
||||||
setIsPanning(false);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user