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,
|
||||
registerImmediatePanUpdate,
|
||||
} = viewer;
|
||||
const [isPanning, setIsPanning] = useState<boolean>(() => viewer.getPanState()?.isPanning ?? false);
|
||||
const [isPanning, setIsPanning] = useState<boolean>(false);
|
||||
const { sidebarRefs } = useSidebarContext();
|
||||
const { position: tooltipPosition } = useRightRailTooltipSide(sidebarRefs, 12);
|
||||
const { handleToolSelect, handleToolSelectForced, handleBackToTools } = useToolWorkflow();
|
||||
@@ -194,9 +194,8 @@ export function useViewerRightRailButtons(isRulerActive?: boolean, setIsRulerAct
|
||||
onClick: () => {
|
||||
const next = !isRulerActive;
|
||||
setIsRulerActive?.(next);
|
||||
if (next && viewer.getPanState()?.isPanning) {
|
||||
viewer.panActions.togglePan();
|
||||
setIsPanning(false);
|
||||
if (next && isPanning) {
|
||||
viewer.panActions.disablePan();
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user