diff --git a/src/folk-shape.ts b/src/folk-shape.ts index 187223d..22710b6 100644 --- a/src/folk-shape.ts +++ b/src/folk-shape.ts @@ -347,6 +347,22 @@ export class FolkShape extends HTMLElement { // Get the corner coordinates of the shape for the corresponding handle const rect = this.#rect; + let vector: Point; + switch (event.key) { + case 'ArrowUp': + vector = { x: 0, y: -MOVEMENT_DELTA }; + break; + case 'ArrowDown': + vector = { x: 0, y: MOVEMENT_DELTA }; + break; + case 'ArrowLeft': + vector = { x: -MOVEMENT_DELTA, y: 0 }; + break; + case 'ArrowRight': + vector = { x: MOVEMENT_DELTA, y: 0 }; + break; + } + // Map handle names to corner points const HANDLE_TO_CORNER: Record = { 'resize-top-left': rect.topLeft,