feat(image-annotate): v1.13.0 顶栏瘦身 / 视图按钮归位 / R·O·L 快捷键 / 填充色实时 / 图层解封

1. 顶栏删掉置顶/上移/下移/置底四个层级按钮(图层拖动 + Ctrl+]/[ 已覆盖),
   `.iwb-editor-commands` 整块移除,`updateLayerUI()` / `bindLayerOrderButtons()` 一并清除。
2. 「适应窗口 / 收起侧栏」移到工具栏 DOM 末尾 —— 工具栏是 shrink-to-fit 的
   absolute 居中容器,放最后天然就在最右,无需额外定位。
3. 快捷键:R 矩形、O 圆形、L 箭头;套索从 L 迁到 A(能力不丢),U 与 Shift+U 保留。
   键盘处理改为优先匹配 e.code,修掉中文输入法下 [ ] 变【】导致的失灵。
4. 原生 <input type="color"> 补接 input 事件做实时预览(skipHistory +
   nativeColorSnapped),change 才落一次可撤销提交 —— 拖一整轮色谱只记 1 步。
5. 原图不再钉底:planPanelOrder / updateSortTarget / onSortEnd / moveLayer /
   mergeUnits 五处解封,其他图层可拖到原图下方,面板提示同步更新。

回归:tools/harness.mjs 140 → 192 条全通;npm run validate 9/9。
This commit is contained in:
qiqi committed 2026-11-08 22:26:47 +08:00
1 parent 9c938887c1
commit 31866a2407
11 files changed
+847 -242

No files matched your search

+4 -6
View File
@@ -15,7 +15,7 @@ import { drawPlacementPreview } from './placement.js'
import { drawShape, setTool } from './tools.js'
import { saveSnapshot, snapshotState } from './history.js'
import { toast } from './commands.js'
import { renderOptionBar, updateLayerUI } from './events.js'
import { renderOptionBar } from './events.js'
import { fontOf, newTextStyle, textBox } from './text.js'
import { drawGuides } from './snap.js'
import { isDrawableLayer } from '../vendor/layer-logic.js'
@@ -251,12 +251,11 @@ import { isDrawableLayer } from '../vendor/layer-logic.js'
if (!sel) { toast('先在画布或图层面板选中要调整的元素', 'info'); return }
if (sel.obj.locked || sel.obj.id === 'base') return
const units = layerUnits()
// base 是锁定且不透明的底图,固定在最下层;任何元素都不许置底到它下面(否则等于消失)
const baseIdx = units.findIndex(u => u.obj.id === 'base')
if (baseIdx > 0) { const [b] = units.splice(baseIdx, 1); units.unshift(b) }
// v1.13:不再把原图钉在最底层 —— 「置底」可以真的沉到原图下面(垫背景层的常见用法)。
// 原图行本身仍不可参与(上面已 return),避免把底图整层挪走。
const from = units.findIndex(u => u.obj === sel.obj)
if (from < 0) return
const min = baseIdx >= 0 ? 1 : 0
const min = 0
let to
if (dir === 'up') to = Math.min(from + 1, units.length - 1)
else if (dir === 'down') to = Math.max(from - 1, min)
@@ -500,7 +499,6 @@ import { isDrawableLayer } from '../vendor/layer-logic.js'
const penShape = getPenEditingShape()
if (penShape) drawPenEditOverlay(penShape)
if (S.cropRect) drawCropPreview()
updateLayerUI()
}
// ============ 钢笔二次编辑(移动/添加/删除节点) ============