feat(image-annotate): 1.2.6 图层新建/导入回面板标题栏 + 还原图标改循环重置 + 适应窗口真重算 fit + 全量 PS 快捷键(V/M/L/B/E/P/T/U/C/I/H, Ctrl+0/1/S/O/Shift+N, Tab, Shift+U/M)
This commit is contained in:
1 parent
c87cec659b
commit
9e50697dd6
7 files changed
+304
-90
No files matched your search
+120
-43
@@ -9,7 +9,7 @@
|
||||
var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
id: 'image-annotate',
|
||||
name: '标注 / 修图',
|
||||
version: '1.2.5',
|
||||
version: '1.2.6',
|
||||
apiVersion: 1,
|
||||
capabilities: ['commands', 'nodeActions', 'canvas', 'canvasWrite'],
|
||||
settings: {
|
||||
@@ -2654,15 +2654,10 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
<div class="iwb-editor-history">
|
||||
<button class="iwb-editor-action" data-action="undo" title="撤销 (Ctrl+Z)"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="1 4 1 10 7 10"/><path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"/></svg></button>
|
||||
<button class="iwb-editor-action" data-action="redo" title="重做 (Ctrl+Shift+Z)"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="23 4 23 10 17 10"/><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/></svg></button>
|
||||
<button class="iwb-editor-action iwb-editor-action-reset" data-action="reset" title="还原原图:删掉所有标注/图层,回到打开时的样子(Ctrl+Z 可撤销)"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg></button>
|
||||
<button class="iwb-editor-action iwb-editor-action-reset" data-action="reset" title="还原原图:删掉所有标注/图层,回到打开时的样子(Ctrl+Z 可撤销)"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 2v6h-6"/><path d="M3 12a9 9 0 0 1 15-6.7L21 8"/><path d="M3 22v-6h6"/><path d="M21 12a9 9 0 0 1-15 6.7L3 16"/></svg></button>
|
||||
</div>
|
||||
<!-- 顶栏命令带(v1.2.4):原「更多 ▾」菜单全部铺开成图标,按 图层 / 顺序 / 视图 分三组 -->
|
||||
<!-- 顶栏命令带(v1.2.6):撤销/重做/还原 | 顺序 | 视图;图层新建/导入回图层面板标题栏 -->
|
||||
<div class="iwb-editor-commands">
|
||||
<div class="iwb-editor-cmdgroup" data-group="layers">
|
||||
<button class="iwb-editor-action" data-action="addBlankLayer" title="新建空白图层"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><line x1="12" y1="8" x2="12" y2="16"/><line x1="8" y1="12" x2="16" y2="12"/></svg></button>
|
||||
<button class="iwb-editor-action" data-action="addBitmapLayer" title="导入图片为图层(也可直接 ⌘/Ctrl+V 粘贴剪贴板图片)"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.1-3.1a2 2 0 0 0-2.8 0L6 21"/><line x1="19" y1="8" x2="19" y2="14"/><line x1="22" y1="11" x2="16" y2="11"/></svg></button>
|
||||
</div>
|
||||
<span class="iwb-editor-divider"></span>
|
||||
<div class="iwb-editor-cmdgroup" data-group="order" title="调整选中元素的图层顺序">
|
||||
<button class="iwb-editor-layer-btn" data-layer="top" title="置顶:选中元素移到最上层 (Ctrl+Shift+])"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="4" y1="5" x2="20" y2="5"/><line x1="12" y1="19" x2="12" y2="5"/><polyline points="6 11 12 5 18 11"/></svg></button>
|
||||
<button class="iwb-editor-layer-btn" data-layer="up" title="上移一层 (Ctrl+])"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="19" x2="12" y2="5"/><polyline points="6 11 12 5 18 11"/></svg></button>
|
||||
@@ -2671,38 +2666,38 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
</div>
|
||||
<span class="iwb-editor-divider"></span>
|
||||
<div class="iwb-editor-cmdgroup" data-group="view">
|
||||
<button class="iwb-editor-action" data-action="zoomFit" title="适应窗口"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 3 3 3 3 9"/><polyline points="15 3 21 3 21 9"/><polyline points="3 15 3 21 9 21"/><polyline points="21 15 21 21 15 21"/></svg></button>
|
||||
<button class="iwb-editor-action" data-action="togglePanels" title="收起 / 展开侧栏(画布优先)"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="16" rx="2"/><line x1="9" y1="4" x2="9" y2="20"/></svg></button>
|
||||
<button class="iwb-editor-action" data-action="zoomFit" title="适应窗口 (Ctrl+0)"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 3 3 3 3 9"/><polyline points="15 3 21 3 21 9"/><polyline points="3 15 3 21 9 21"/><polyline points="21 15 21 21 15 21"/></svg></button>
|
||||
<button class="iwb-editor-action" data-action="togglePanels" title="收起 / 展开侧栏 (Tab)"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="16" rx="2"/><line x1="9" y1="4" x2="9" y2="20"/></svg></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="iwb-editor-tools">
|
||||
<button class="iwb-editor-tool" data-tool="select" title="选择/移动:点击元素选中,拖拽移动,手柄调整大小,双击文字改内容"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z"/></svg></button>
|
||||
<button class="iwb-editor-tool" data-tool="select" title="选择/移动 (V):点击元素选中,拖拽移动,手柄调整大小,双击文字改内容"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z"/></svg></button>
|
||||
<span class="iwb-editor-divider"></span>
|
||||
|
||||
<button class="iwb-editor-tool" data-tool="marquee" title="框选:拖出矩形/椭圆选区,松手后旁边出现操作条(M)"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="4 3"><rect x="3" y="4" width="18" height="16" rx="1"/></svg></button>
|
||||
<button class="iwb-editor-tool" data-tool="lasso" title="套索:按住拖动自由圈选,松手闭合(L)"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 12c0-4 3.6-7 8-7s8 3 8 7-3.6 7-8 7c-2 0-3.8-.6-5.2-1.6"/><path d="M6.8 17.4 4 20l1.2-3.2"/><circle cx="20" cy="19" r="2"/></svg></button>
|
||||
<button class="iwb-editor-tool" data-tool="marquee" title="选框 (M):拖出矩形/椭圆选区,松手后旁边出现操作条;Shift+M 切换矩形/椭圆"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="4 3"><rect x="3" y="4" width="18" height="16" rx="1"/></svg></button>
|
||||
<button class="iwb-editor-tool" data-tool="lasso" title="套索 (L):按住拖动自由圈选,松手闭合"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 12c0-4 3.6-7 8-7s8 3 8 7-3.6 7-8 7c-2 0-3.8-.6-5.2-1.6"/><path d="M6.8 17.4 4 20l1.2-3.2"/><circle cx="20" cy="19" r="2"/></svg></button>
|
||||
|
||||
<button class="iwb-editor-tool active" data-tool="brush" title="画笔"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"/><path d="m15 5 4 4"/></svg></button>
|
||||
<button class="iwb-editor-tool active" data-tool="brush" title="画笔 (B)"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"/><path d="m15 5 4 4"/></svg></button>
|
||||
|
||||
<button class="iwb-editor-tool" data-tool="eraser" title="橡皮:擦除当前活跃图层的内容,与画笔共用大小/硬度/透明度"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21"/><path d="M22 21H7"/><path d="m5 11 9 9"/></svg></button>
|
||||
<button class="iwb-editor-tool" data-tool="eraser" title="橡皮 (E):擦除当前活跃图层的内容,与画笔共用大小/硬度/透明度"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21"/><path d="M22 21H7"/><path d="m5 11 9 9"/></svg></button>
|
||||
|
||||
<button class="iwb-editor-tool" data-tool="pen" title="钢笔:点击添加节点,双击或 Enter 完成自定义形状"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m12 19 7-7 3 3-7 7-3-3z"/><path d="m18 13-1.5-7.5L2 2l3.5 14.5L13 18l5-5z"/><path d="m2 2 7.586 7.586"/><circle cx="11" cy="11" r="2"/></svg></button>
|
||||
<button class="iwb-editor-tool" data-tool="pen" title="钢笔 (P):点击添加节点,双击或 Enter 完成自定义形状"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m12 19 7-7 3 3-7 7-3-3z"/><path d="m18 13-1.5-7.5L2 2l3.5 14.5L13 18l5-5z"/><path d="m2 2 7.586 7.586"/><circle cx="11" cy="11" r="2"/></svg></button>
|
||||
|
||||
<button class="iwb-editor-tool" data-tool="text" title="文字"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 7 4 3 20 3 20 7"/><line x1="9" y1="20" x2="15" y2="20"/><line x1="12" y1="3" x2="12" y2="20"/></svg></button>
|
||||
<button class="iwb-editor-tool" data-tool="text" title="文字 (T)"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 7 4 3 20 3 20 7"/><line x1="9" y1="20" x2="15" y2="20"/><line x1="12" y1="3" x2="12" y2="20"/></svg></button>
|
||||
|
||||
<button class="iwb-editor-tool" data-tool="rect" title="矩形框"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/></svg></button>
|
||||
<button class="iwb-editor-tool" data-tool="rect" title="矩形 (U):Shift+U 在矩形/圆形/箭头间循环"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/></svg></button>
|
||||
|
||||
<button class="iwb-editor-tool" data-tool="circle" title="圆形"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="8"/></svg></button>
|
||||
<button class="iwb-editor-tool" data-tool="circle" title="圆形 (U):Shift+U 在矩形/圆形/箭头间循环"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="8"/></svg></button>
|
||||
|
||||
<button class="iwb-editor-tool" data-tool="arrow" title="箭头"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="5" y1="12" x2="19" y2="12"/><polyline points="12 5 19 12 12 19"/></svg></button>
|
||||
<button class="iwb-editor-tool" data-tool="arrow" title="箭头 (U):Shift+U 在矩形/圆形/箭头间循环"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="5" y1="12" x2="19" y2="12"/><polyline points="12 5 19 12 12 19"/></svg></button>
|
||||
|
||||
<button class="iwb-editor-tool" data-tool="picker" title="吸管:点击画布取色(悬停预览),取色后自动切回上一工具"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m2 22 1-1h3l9-9"/><path d="M3 21v-3l9-9"/><path d="m15 6 3.4-3.4a2.1 2.1 0 1 1 3 3L18 9l.4.4a2.1 2.1 0 1 1-3 3l-3.8-3.8a2.1 2.1 0 1 1 3-3Z"/></svg></button>
|
||||
<button class="iwb-editor-tool" data-tool="picker" title="吸管 (I):点击画布取色(悬停预览),取色后自动切回上一工具"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m2 22 1-1h3l9-9"/><path d="M3 21v-3l9-9"/><path d="m15 6 3.4-3.4a2.1 2.1 0 1 1 3 3L18 9l.4.4a2.1 2.1 0 1 1-3 3l-3.8-3.8a2.1 2.1 0 1 1 3-3Z"/></svg></button>
|
||||
|
||||
<button class="iwb-editor-tool" data-tool="hand" title="抓手:拖拽自由移动画布(任意工具下按住空格或鼠标中键也可平移)"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 11V6a2 2 0 0 0-2-2v0a2 2 0 0 0-2 2v0"/><path d="M14 10V4a2 2 0 0 0-2-2v0a2 2 0 0 0-2 2v2"/><path d="M10 10.5V6a2 2 0 0 0-2-2v0a2 2 0 0 0-2 2v8"/><path d="M18 10a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15"/></svg></button>
|
||||
<button class="iwb-editor-tool" data-tool="hand" title="抓手 (H):拖拽自由移动画布(任意工具下按住空格或鼠标中键也可平移)"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 11V6a2 2 0 0 0-2-2v0a2 2 0 0 0-2 2v0"/><path d="M14 10V4a2 2 0 0 0-2-2v0a2 2 0 0 0-2 2v2"/><path d="M10 10.5V6a2 2 0 0 0-2-2v0a2 2 0 0 0-2 2v8"/><path d="M18 10a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15"/></svg></button>
|
||||
|
||||
<span class="iwb-editor-divider"></span>
|
||||
|
||||
<button class="iwb-editor-tool" data-tool="crop" title="裁剪(参数在选项栏;Enter 确认 / Esc 取消)"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6.13 1L6 16a2 2 0 0 0 2 2h15"/><path d="M1 6.13L16 6a2 2 0 0 1 2 2v15"/></svg></button>
|
||||
<button class="iwb-editor-tool" data-tool="crop" title="裁剪 (C):参数在选项栏;Enter 确认 / Esc 取消"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6.13 1L6 16a2 2 0 0 0 2 2h15"/><path d="M1 6.13L16 6a2 2 0 0 1 2 2v15"/></svg></button>
|
||||
|
||||
<span class="iwb-editor-divider"></span>
|
||||
</div>
|
||||
@@ -2748,14 +2743,18 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
<div class="iwb-editor-optionbar">
|
||||
<span class="iwb-editor-optionbar-label">工具选项</span>
|
||||
<div class="iwb-editor-optionbar-body"></div>
|
||||
<span class="iwb-editor-optionbar-tip">选区操作也可以右键,或用 Ctrl+J / Delete / Esc</span>
|
||||
<span class="iwb-editor-optionbar-tip">选区也可右键;Ctrl+J 复制 · Delete 清除 · Ctrl+D 取消</span>
|
||||
</div>
|
||||
<div class="iwb-editor-main">
|
||||
|
||||
<div class="iwb-editor-layer-panel">
|
||||
<div class="iwb-editor-layer-panel-header">
|
||||
<span class="iwb-editor-layer-panel-title">图层</span>
|
||||
<!-- 新建图层 / 导入图片已上移到顶栏命令带(v1.2.4),面板只留标题,避免同一功能两个入口 -->
|
||||
<!-- 图层的「新建 / 导入图片」回到标题栏右侧(用户裁定 2026-11-04:顶栏只留顺序与视图命令) -->
|
||||
<div class="iwb-editor-layer-add-group">
|
||||
<button class="iwb-editor-layer-add-btn" data-action="addBlankLayer" title="新建空白图层 (Ctrl+Shift+N)"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><line x1="12" y1="8" x2="12" y2="16"/><line x1="8" y1="12" x2="16" y2="12"/></svg></button>
|
||||
<button class="iwb-editor-layer-add-btn" data-action="addBitmapLayer" title="导入图片为新图层 (Ctrl+O),也可直接 ⌘/Ctrl+V 粘贴剪贴板图片"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.1-3.1a2 2 0 0 0-2.8 0L6 21"/><line x1="19" y1="8" x2="19" y2="14"/><line x1="22" y1="11" x2="16" y2="11"/></svg></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 图层顺序(置顶/上移/下移/置底)已移到顶栏命令带(v1.2.4) -->
|
||||
@@ -2792,9 +2791,9 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
<!-- 描边粗细/快捷点已从侧栏移除(用户裁定 2026-11-04):都收进工具选项栏一处,
|
||||
侧栏只保留调色板与缩放,避免「同一参数两个入口、数值还对不上」 -->
|
||||
<div class="iwb-editor-zoom">
|
||||
<button class="iwb-editor-zoom-btn" data-action="zoomOut" title="缩小 (滚轮向下)">−</button>
|
||||
<button class="iwb-editor-zoom-btn" data-action="zoomOut" title="缩小 (Ctrl+- / 滚轮向下)">−</button>
|
||||
<span class="iwb-editor-zoom-val" title="滚轮缩放">100%</span>
|
||||
<button class="iwb-editor-zoom-btn" data-action="zoomIn" title="放大 (滚轮向上)">+</button>
|
||||
<button class="iwb-editor-zoom-btn" data-action="zoomIn" title="放大 (Ctrl++ / 滚轮向上)">+</button>
|
||||
<button class="iwb-editor-zoom-btn iwb-editor-zoom-fit" data-action="zoomFit" title="适应窗口">适应</button>
|
||||
</div>
|
||||
</aside>
|
||||
@@ -3885,6 +3884,20 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
}
|
||||
syncOptionBar();
|
||||
}
|
||||
function togglePanelsCollapsed() {
|
||||
const root = runtime.el;
|
||||
if (!root) return;
|
||||
const collapsed = !root.classList.contains("panels-collapsed");
|
||||
root.classList.toggle("panels-collapsed", collapsed);
|
||||
const st = S.callbacks && S.callbacks.settings;
|
||||
if (st && typeof st.set === "function") {
|
||||
try {
|
||||
st.set("panelsCollapsed", collapsed);
|
||||
} catch (err) {
|
||||
}
|
||||
}
|
||||
toast(collapsed ? "侧栏已收起" : "侧栏已展开", "info");
|
||||
}
|
||||
function bindLiteUI() {
|
||||
const root = runtime.el;
|
||||
if (!root || root.dataset.liteBound === "1") return;
|
||||
@@ -3909,16 +3922,7 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
btn.addEventListener("mousedown", (e) => e.stopPropagation());
|
||||
btn.addEventListener("click", (e) => {
|
||||
e.stopPropagation();
|
||||
const collapsed = !root.classList.contains("panels-collapsed");
|
||||
root.classList.toggle("panels-collapsed", collapsed);
|
||||
const st = S.callbacks && S.callbacks.settings;
|
||||
if (st && typeof st.set === "function") {
|
||||
try {
|
||||
st.set("panelsCollapsed", collapsed);
|
||||
} catch (err) {
|
||||
}
|
||||
}
|
||||
toast(collapsed ? "侧栏已收起" : "侧栏已展开", "info");
|
||||
togglePanelsCollapsed();
|
||||
closeMenus();
|
||||
});
|
||||
});
|
||||
@@ -4503,6 +4507,59 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
if (isTyping(e)) return;
|
||||
const mod = e.ctrlKey || e.metaKey;
|
||||
const key = String(e.key || "").toLowerCase();
|
||||
const letterTools = {
|
||||
v: "select",
|
||||
m: "marquee",
|
||||
l: "lasso",
|
||||
b: "brush",
|
||||
e: "eraser",
|
||||
p: "pen",
|
||||
t: "text",
|
||||
u: "rect",
|
||||
c: "crop",
|
||||
i: "picker",
|
||||
h: "hand"
|
||||
};
|
||||
if (!mod && !e.altKey && Object.prototype.hasOwnProperty.call(letterTools, key)) {
|
||||
e.preventDefault();
|
||||
if (e.shiftKey && key === "u") {
|
||||
const cycle = { rect: "circle", circle: "arrow", arrow: "rect" };
|
||||
setTool(cycle[S.tool] || "rect");
|
||||
} else if (e.shiftKey && key === "m") {
|
||||
S.selectionKind = S.selectionKind === "ellipse" ? "rect" : "ellipse";
|
||||
setTool("marquee");
|
||||
toast("选区形状:" + (S.selectionKind === "ellipse" ? "椭圆" : "矩形"), "info");
|
||||
renderOptionBar(true);
|
||||
} else {
|
||||
setTool(letterTools[key]);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!mod && !e.altKey && key === "tab") {
|
||||
e.preventDefault();
|
||||
togglePanelsCollapsed();
|
||||
return;
|
||||
}
|
||||
if (mod && !e.shiftKey && e.key === "0") {
|
||||
e.preventDefault();
|
||||
setZoomFit();
|
||||
return;
|
||||
}
|
||||
if (mod && !e.shiftKey && e.key === "1") {
|
||||
e.preventDefault();
|
||||
setZoomActual();
|
||||
return;
|
||||
}
|
||||
if (mod && (e.key === "+" || e.key === "=")) {
|
||||
e.preventDefault();
|
||||
zoomStep(ZOOM_STEP, S.canvasWrap.clientWidth / 2, S.canvasWrap.clientHeight / 2);
|
||||
return;
|
||||
}
|
||||
if (mod && e.key === "-") {
|
||||
e.preventDefault();
|
||||
zoomStep(1 / ZOOM_STEP, S.canvasWrap.clientWidth / 2, S.canvasWrap.clientHeight / 2);
|
||||
return;
|
||||
}
|
||||
if (mod && key === "a") {
|
||||
e.preventDefault();
|
||||
runCommand("sel.all");
|
||||
@@ -4528,16 +4585,21 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
runCommand("sel.cut");
|
||||
return;
|
||||
}
|
||||
const toolByKey = { "1": "select", "2": "brush", "3": "eraser", "4": "pen", "5": "text", "6": "rect", "7": "circle", "8": "arrow", "9": "picker", "0": "crop" };
|
||||
const letterTools = { m: "marquee", l: "lasso", v: "select", b: "brush", e: "eraser", t: "text", c: "crop" };
|
||||
if (!mod && !e.altKey && Object.prototype.hasOwnProperty.call(toolByKey, e.key)) {
|
||||
if (mod && e.shiftKey && key === "n") {
|
||||
e.preventDefault();
|
||||
setTool(toolByKey[e.key]);
|
||||
addBlankLayer();
|
||||
return;
|
||||
}
|
||||
if (!mod && !e.altKey && Object.prototype.hasOwnProperty.call(letterTools, key)) {
|
||||
if (mod && !e.shiftKey && key === "o") {
|
||||
e.preventDefault();
|
||||
setTool(letterTools[key]);
|
||||
const b = runtime.el && runtime.el.querySelector('[data-action="addBitmapLayer"]');
|
||||
if (b) b.click();
|
||||
return;
|
||||
}
|
||||
if (mod && key === "s") {
|
||||
e.preventDefault();
|
||||
const b = runtime.el && runtime.el.querySelector('[data-action="download"]');
|
||||
if (b) b.click();
|
||||
return;
|
||||
}
|
||||
if (e.key === "Delete" || e.key === "Backspace") {
|
||||
@@ -4577,6 +4639,12 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
e.preventDefault();
|
||||
if (e.shiftKey) redo();
|
||||
else undo();
|
||||
return;
|
||||
}
|
||||
if (mod && key === "y") {
|
||||
e.preventDefault();
|
||||
redo();
|
||||
return;
|
||||
}
|
||||
}
|
||||
function onKeyup(e) {
|
||||
@@ -4808,10 +4876,17 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
applyView({ mx, my, px, py });
|
||||
}
|
||||
function setZoomFit() {
|
||||
computeFit();
|
||||
S.zoom = 1;
|
||||
S.viewX = null;
|
||||
applyView();
|
||||
}
|
||||
function setZoomActual() {
|
||||
computeFit();
|
||||
S.zoom = clamp(S.fitW ? S.imgW / S.fitW : 1, ZOOM_MIN, ZOOM_MAX);
|
||||
S.viewX = null;
|
||||
applyView();
|
||||
}
|
||||
function clamp(v, min, max) {
|
||||
return Math.max(min, Math.min(max, v));
|
||||
}
|
||||
@@ -6034,6 +6109,8 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
open: S.open,
|
||||
tool: S.tool,
|
||||
doc: { w: S.imgW, h: S.imgH },
|
||||
zoom: S.zoom,
|
||||
fit: { w: Math.round(S.fitW || 0), h: Math.round(S.fitH || 0) },
|
||||
layers: S.layers.map((l) => ({ id: l.id, name: l.name, z: l.z, locked: !!l.locked, visible: l.visible !== false })),
|
||||
shapes: S.shapeLayers.map((s) => ({ id: s.id, type: s.type, lw: s.lw, fill: !!s.fill, closed: !!s.closed })),
|
||||
texts: S.textLayers.map((t) => ({ id: t.id, text: t.text })),
|
||||
|
||||
Reference in new issue
Block a user