Fix: Ctrl+scroll i panel resizer rammen, ikke bare innholdet

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
vegard 2026-03-20 03:02:07 +00:00
parent e94c22fcb8
commit c1a69feede

View file

@ -73,7 +73,6 @@
let dropFeedback = $state<string>('');
let isResizing = $state(false);
let isDragging = $state(false);
let contentZoom = $state(1.0);
let containerEl: HTMLDivElement | undefined = $state();
let containerWidth = $state(0);
@ -426,14 +425,14 @@
<!-- svelte-ignore a11y_no_static_element_interactions -->
<div
class="blockshell-content"
style:transform="scale({contentZoom})"
style:transform-origin="top left"
onwheel={(e) => {
if (e.ctrlKey || e.metaKey) {
e.preventDefault();
e.stopPropagation();
const factor = e.deltaY > 0 ? 0.95 : 1.05;
contentZoom = Math.min(3, Math.max(0.3, contentZoom * factor));
const newW = Math.round(clampedWidth * factor);
const newH = Math.round(clampedHeight * factor);
onResize?.(newW, newH);
}
}}
>