Canvas: toolbar fungerer, dobbeltklikk = tilpass visning, diskret seleksjon
- Toolbar-knapper (zoom, tilpass, grid, fullskjerm) blokkert av Canvas
sin pointerdown-handler. Fikset med closest('.canvas-toolbar')-sjekk.
- Dobbeltklikk på tom flate kjører zoomToFit() for rask navigasjon.
- Seleksjon-ramme dempet: 1px rgba(accent, 0.4) i stedet for 2px solid.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
b37746207a
commit
6101bf00b1
1 changed files with 11 additions and 2 deletions
|
|
@ -164,6 +164,9 @@
|
|||
// --- Pointer events ---
|
||||
function handlePointerDown(e: PointerEvent) {
|
||||
if (!containerEl) return;
|
||||
// Ignore clicks on toolbar and other UI overlays
|
||||
if ((e.target as HTMLElement).closest('.canvas-toolbar')) return;
|
||||
|
||||
const rect = containerEl.getBoundingClientRect();
|
||||
const sx = e.clientX - rect.left;
|
||||
const sy = e.clientY - rect.top;
|
||||
|
|
@ -412,6 +415,12 @@
|
|||
onpointerdown={handlePointerDown}
|
||||
onpointermove={handlePointerMove}
|
||||
onpointerup={handlePointerUp}
|
||||
ondblclick={(e) => {
|
||||
if (!(e.target as HTMLElement).closest('[data-canvas-object-id]') &&
|
||||
!(e.target as HTMLElement).closest('.canvas-toolbar')) {
|
||||
zoomToFit();
|
||||
}
|
||||
}}
|
||||
ontouchstart={handleTouchStart}
|
||||
ontouchmove={handleTouchMove}
|
||||
ontouchend={handleTouchEnd}
|
||||
|
|
@ -541,8 +550,8 @@
|
|||
}
|
||||
|
||||
.canvas-object-selected {
|
||||
outline: 2px solid #3b82f6;
|
||||
outline-offset: 2px;
|
||||
outline: 1px solid rgba(99, 102, 241, 0.4);
|
||||
outline-offset: 1px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue