Fix foldable background layout

This commit is contained in:
Codex Agent
2026-01-24 10:41:24 +01:00
parent 6c83f4ee4e
commit 0f4d7450ff
4 changed files with 201 additions and 48 deletions

View File

@@ -15,8 +15,10 @@ export async function withFabricCanvas<T>(
handler: (canvas: fabric.Canvas, element: HTMLCanvasElement) => Promise<T>,
): Promise<T> {
const canvasElement = document.createElement('canvas');
canvasElement.width = CANVAS_WIDTH;
canvasElement.height = CANVAS_HEIGHT;
const targetWidth = options.canvasWidth ?? CANVAS_WIDTH;
const targetHeight = options.canvasHeight ?? CANVAS_HEIGHT;
canvasElement.width = targetWidth;
canvasElement.height = targetHeight;
const canvas = new fabric.Canvas(canvasElement, {
selection: false,