feat: Introduce new LayoutSystem and spatial workspace architecture design document, refactor document card and workspace to use it, and simplify pointer event handling.

This commit is contained in:
2025-11-26 13:39:19 +01:00
parent 27eea08605
commit bbf7d23c96
6 changed files with 167 additions and 113 deletions
+19
View File
@@ -33,3 +33,22 @@ export const computeCardBounds = ({
maxY: Math.max(padding + halfH, canvasHeight - padding - halfH),
};
};
export const constrainDimensions = (width: number, height: number, maxDimension: number) => {
if (width <= maxDimension && height <= maxDimension) {
return { width, height };
}
const aspect = width / height;
if (width > height) {
return {
width: maxDimension,
height: maxDimension / aspect
};
} else {
return {
width: maxDimension * aspect,
height: maxDimension
};
}
};