add back vector to shape

This commit is contained in:
“chrisshank” 2024-12-07 13:23:48 -08:00
parent 8fdcb3b3f7
commit 2b536ee188
1 changed files with 16 additions and 0 deletions

View File

@ -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<string, Point> = {
'resize-top-left': rect.topLeft,