From 5f389c7b71bfe063ec542c6f47918f267d6edb15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Fri, 21 Nov 2025 20:09:52 +0100 Subject: [PATCH] feat(phase-13): implement canvas resize dialog with multiple methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add comprehensive canvas resize functionality with three resize methods. Features: - Canvas Size dialog accessible from Image menu - Three resize methods: * Scale: Stretch/shrink content to fit new size * Crop: Crop or center content without scaling * Expand: Expand canvas, center existing content - Maintain aspect ratio toggle with link/unlink button - Dimension validation (1-10000 pixels) - Real-time preview of new dimensions - Applies to all layers simultaneously - Toast notifications for success/errors Changes: - Created components/modals/canvas-resize-dialog.tsx - Added "Canvas Size..." menu item to Image menu - Integrated with useLayerStore for layer updates - Uses toast utility for user feedback - Validates dimensions before applying - Supports linked/unlinked aspect ratio 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- components/editor/image-menu.tsx | 20 ++ components/modals/canvas-resize-dialog.tsx | 238 +++++++++++++++++++++ 2 files changed, 258 insertions(+) create mode 100644 components/modals/canvas-resize-dialog.tsx diff --git a/components/editor/image-menu.tsx b/components/editor/image-menu.tsx index 2c323cd..990855b 100644 --- a/components/editor/image-menu.tsx +++ b/components/editor/image-menu.tsx @@ -2,14 +2,17 @@ import { useState } from 'react'; import { AdjustmentsDialog } from '@/components/modals/adjustments-dialog'; +import { CanvasResizeDialog } from '@/components/modals/canvas-resize-dialog'; import { Sliders, ChevronDown, + Maximize2, } from 'lucide-react'; export function ImageMenu() { const [isMenuOpen, setIsMenuOpen] = useState(false); const [isAdjustmentsOpen, setIsAdjustmentsOpen] = useState(false); + const [isCanvasResizeOpen, setIsCanvasResizeOpen] = useState(false); return ( <> @@ -48,6 +51,17 @@ export function ImageMenu() {