15 lines
575 B
TypeScript
15 lines
575 B
TypeScript
import { getUiPreferences, patchUiPreferences } from './uiPreferencesDb';
|
|
|
|
export type CanvasInteractionMode = 'pan' | 'select';
|
|
/** @deprecated CanvasInteractionMode */
|
|
export type StrategyCanvasInteractionMode = CanvasInteractionMode;
|
|
|
|
export function loadCanvasInteractionMode(): CanvasInteractionMode {
|
|
const mode = getUiPreferences().strategyEditor?.canvasInteraction;
|
|
return mode === 'pan' ? 'pan' : 'select';
|
|
}
|
|
|
|
export function saveCanvasInteractionMode(mode: CanvasInteractionMode): void {
|
|
patchUiPreferences({ strategyEditor: { canvasInteraction: mode } });
|
|
}
|