From 0b7f84b07159b83c3a8e0e0410940b7d31859626 Mon Sep 17 00:00:00 2001 From: Jz0ojiang Date: Sat, 5 Sep 2026 18:39:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=83=8C=E6=99=AF=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E9=94=81=E5=AE=9A=EF=BC=9B=E8=A1=A5=20ShapeMenu=20=E7=9A=84=20?= =?UTF-8?q?close=20=E7=BB=91=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 背景铺满整个画板,不锁的话画布上就没有「空白处」了:想框选、想点空白取消选中, 实际都会抓住背景整个拖走(实测一次误拖就把底图挪出画板)。但也不能做成永久 不可选——用户对背景的核心需求正是「调整/缩放/裁剪一下」。锁定是可见且可撤销的: 图层面板那一行的锁图标点一下就解开,解开后拖拽缩放和普通图层完全一样。 走 layerLocked 而不是直接写 selectable:false,因为锁定态由 applyLocked 统一管, 自己写 selectable 会被 object:added 触发的 registerLayer 翻回去。 TopBar 没把 Dropdown 的 close 传给 ShapeMenu,选完形状下拉不收。 顺带删掉 useEditor.addRect:形状改成拖拽创建之后没有调用方了。 --- src/components/TopBar.vue | 4 ++-- src/editor/useBackground.ts | 22 +++++++++++++++++----- src/editor/useEditor.ts | 26 -------------------------- 3 files changed, 19 insertions(+), 33 deletions(-) diff --git a/src/components/TopBar.vue b/src/components/TopBar.vue index 01b76cc..c4c4e11 100644 --- a/src/components/TopBar.vue +++ b/src/components/TopBar.vue @@ -168,8 +168,8 @@ async function scrollToExport() { -