fix: Resolve pan control configuration issues

- Fix middle and right click settings being switched
- Resolve conflict when both middle and right click are enabled
- Correct inverted Ctrl/Alt toggle display states

Closes #57
This commit is contained in:
Stan
2025-08-17 15:20:11 +01:00
parent 179b512c7d
commit 2310b85995
2 changed files with 10 additions and 10 deletions

View File

@@ -74,7 +74,7 @@ export const PanSettings = () => {
<FormControlLabel
control={
<Switch
checked={panSettings.ctrlClickPan}
checked={!panSettings.ctrlClickPan}
onChange={() => handleToggle('ctrlClickPan')}
/>
}
@@ -84,7 +84,7 @@ export const PanSettings = () => {
<FormControlLabel
control={
<Switch
checked={panSettings.altClickPan}
checked={!panSettings.altClickPan}
onChange={() => handleToggle('altClickPan')}
/>
}

View File

@@ -51,20 +51,20 @@ export const usePanHandlers = () => {
const handleMouseDown = useCallback((e: SlimMouseEvent): boolean => {
const panSettings = uiState.panSettings;
// Middle click pan
if (panSettings.middleClickPan && e.button === 1) {
e.preventDefault();
startPan('middle');
return true;
}
// Right click pan
// Right click pan (button 2)
if (panSettings.rightClickPan && e.button === 2) {
e.preventDefault();
startPan('right');
return true;
}
// Middle click pan (button 1)
if (panSettings.middleClickPan && e.button === 1) {
e.preventDefault();
startPan('middle');
return true;
}
// Ctrl + click pan
if (panSettings.ctrlClickPan && e.ctrlKey && e.button === 0) {
e.preventDefault();