Skip to content

Commit d3cac7a

Browse files
committed
Use GRID_SIZE constant for keyboard nudge steps
1 parent c722f52 commit d3cac7a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/routes/+page.svelte

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import { nodeRegistry } from '$lib/nodes';
2828
import { NODE_TYPES } from '$lib/constants/nodeTypes';
2929
import { PANEL_GAP, PANEL_TOGGLES_WIDTH, MIN_BOTTOM_PANEL_WIDTH, PANEL_DEFAULTS, NAV_HEIGHT } from '$lib/constants/layout';
30+
import { GRID_SIZE } from '$lib/constants/grid';
3031
import { DEFAULT_SIMULATION_SETTINGS } from '$lib/nodes/types';
3132
import { graphStore } from '$lib/stores/graph';
3233
import { eventStore } from '$lib/stores/events';
@@ -681,8 +682,8 @@
681682
// Handle arrow keys - nudge selected nodes or pan canvas
682683
function handleArrowKey(direction: string, largeStep: boolean) {
683684
const hasSelection = hasAnySelection();
684-
const panStep = largeStep ? 50 : 20;
685-
const nudgeStep = largeStep ? 20 : 5;
685+
const panStep = largeStep ? GRID_SIZE * 5 : GRID_SIZE * 2;
686+
const nudgeStep = largeStep ? GRID_SIZE * 2 : GRID_SIZE;
686687
687688
const delta = { x: 0, y: 0 };
688689

0 commit comments

Comments
 (0)