feat(image-annotate): v1.2.12 画笔/橡皮按住 Alt 临时吸色(PS 手感)
- 画笔或橡皮下按住 Alt 立即切吸管,点击取色后仍保持吸管(可连续取色),松开 Alt 回到原工具 - S.altPicker 标记区分「真按 I 切吸管」与临时吸管;exitPicker 在 altPicker 下只清缓存不退出 - 兜底:窗口 blur / 主动切别的工具都会结束临时吸管,避免工具卡在 picker - Alt keydown preventDefault(防 Windows 浏览器把单独 Alt 当菜单激活) - __debug 补 color / altPicker;harness 新增 Alt 吸色回归断言(116 项全绿)
This commit is contained in:
1 parent
c176744846
commit
3080916c62
8 files changed
+106
-12
No files matched your search
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@iwb-plugin/image-annotate",
|
||||
"private": true,
|
||||
"version": "1.2.11",
|
||||
"version": "1.2.12",
|
||||
"description": "IWB 插件:图片标注 / 修图(编辑器移植自 iwb-plaus 扩展,纯 Canvas 2D)",
|
||||
"ibwPlugin": {
|
||||
"id": "image-annotate",
|
||||
|
||||
@@ -132,9 +132,9 @@ import { bindEvents } from './events.js'
|
||||
<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="画笔 (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 active" data-tool="brush" title="画笔 (B):] 增大 / [ 减小笔刷;按住 Alt 临时吸色"><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="橡皮 (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="eraser" title="橡皮 (E):] 增大 / [ 减小笔刷;擦除当前活跃图层,与画笔共用大小/硬度/透明度;按住 Alt 临时吸色"><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="钢笔 (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>
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import { S, ZOOM_STEP, runtime } from './state.js'
|
||||
import { ROT_CURSOR, clamp, getPos, isOverRotationHandle, setView, setZoomActual, setZoomFit, zoomStep } from './viewport.js'
|
||||
import { addBitmapLayer, addBlankLayer, applyBitmapDrag, beginBitmapDrag, clearSelection, deleteLayer, ensureWritableLayer, getActiveCtx, getActiveLayer, hitBitmapHandle, removeVecCanvas, renderLayerPanel } from './layers.js'
|
||||
import { applyColorChange, beginStroke, clearToolRing, drawToolRing, endStroke, eraseSegment, exitPicker, hidePickerTip, sampleColor, setTool, showPickerTip, strokeSegment } from './tools.js'
|
||||
import { applyColorChange, beginAltPicker, beginStroke, clearToolRing, drawToolRing, endAltPicker, endStroke, eraseSegment, exitPicker, hidePickerTip, sampleColor, setTool, showPickerTip, strokeSegment } from './tools.js'
|
||||
import { beginMarquee, updateMarquee, endMarquee, beginLasso, updateLasso, endLasso, clearMarquee, syncAnts, renderSelection } from './selection.js'
|
||||
import { runCommand, toast } from './commands.js'
|
||||
import { showSelectionContext, hideSelectionContext } from './floating.js'
|
||||
@@ -1475,6 +1475,8 @@ import { hexToRgb, parseRatio, rgbToHex } from '../vendor/image-math.js'
|
||||
if (S.spaceDown) { S.spaceDown = false; updateCursor() }
|
||||
if (S.panning) { S.panning = false; S.panStart = null; updateCursor() }
|
||||
S._shiftDown = false
|
||||
// Alt 的 keyup 可能落在窗口外,兜底结束临时吸管,避免工具卡在 picker
|
||||
endAltPicker()
|
||||
})
|
||||
|
||||
// 阻止 modal 内部点击冒泡
|
||||
@@ -1687,6 +1689,12 @@ import { hexToRgb, parseRatio, rgbToHex } from '../vendor/image-math.js'
|
||||
if (e.key === 'Escape') { e.preventDefault(); cancelImagePlacement(); return }
|
||||
}
|
||||
if (e.key === 'Shift') S._shiftDown = true
|
||||
// PS:画笔 / 橡皮下按住 Alt 临时吸管(点击取色,松开 Alt 回到原工具)
|
||||
if (e.key === 'Alt' && !e.ctrlKey && !e.metaKey) {
|
||||
e.preventDefault() // 防 Windows 浏览器把单独 Alt 当作菜单栏激活
|
||||
beginAltPicker()
|
||||
return
|
||||
}
|
||||
if (e.key === 'Enter' && S.tool === 'pen' && S.penPath) { e.preventDefault(); commitPenPath(); return }
|
||||
// 裁剪:Enter 确认 / Esc 取消(用户裁定,替代浮窗上的两个按钮 —— 按钮也保留在选项栏)
|
||||
if (e.key === 'Enter' && S.tool === 'crop' && S.cropRect) { e.preventDefault(); confirmCrop(); return }
|
||||
@@ -1857,6 +1865,8 @@ import { hexToRgb, parseRatio, rgbToHex } from '../vendor/image-math.js'
|
||||
|
||||
function onKeyup(e) {
|
||||
if (e.key === 'Shift') S._shiftDown = false
|
||||
// PS:松开 Alt 结束临时吸管,回到画笔 / 橡皮
|
||||
if (e.key === 'Alt') endAltPicker()
|
||||
if (e.code === 'Space' && S.spaceDown) {
|
||||
S.spaceDown = false
|
||||
updateCursor()
|
||||
|
||||
@@ -284,6 +284,8 @@ import { toast } from './commands.js'
|
||||
const __debug = () => ({
|
||||
open: S.open,
|
||||
tool: S.tool,
|
||||
color: S.color,
|
||||
altPicker: !!S.altPicker,
|
||||
doc: { w: S.imgW, h: S.imgH },
|
||||
zoom: S.zoom,
|
||||
fit: { w: Math.round(S.fitW || 0), h: Math.round(S.fitH || 0) },
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
brushHardness: 100, // 画笔硬度 0~100:100=硬边描边,<100=径向渐变软边章
|
||||
brushOpacity: 1, // 画笔透明度 0.05~1(一笔整体透明度,笔划内不叠加)
|
||||
prevTool: null, // 吸管工具激活前的工具(取色后切回)
|
||||
altPicker: false, // 按住 Alt 的临时吸管(画笔/橡皮下),松开 Alt 回到原工具
|
||||
pickerComposite: null, // 吸管取样用的合成画布缓存(切工具/画布变化时失效)
|
||||
rectFill: false, // 矩形/圆形是否实心填充
|
||||
penFill: true, // 钢笔闭合路径是否实心填充(只对闭合路径有意义)
|
||||
|
||||
@@ -321,6 +321,13 @@ import { hexToRgb, rgbToHex } from '../vendor/image-math.js'
|
||||
|
||||
/** 取色完成:切回吸管激活前的工具 */
|
||||
export function exitPicker() {
|
||||
// 按住 Alt 的临时吸管:取色后不退出(PS 手感:Alt 按住期间可连续吸色),
|
||||
// 由 keyup / 窗口失焦时的 endAltPicker() 统一收尾回到原工具
|
||||
if (S.altPicker) {
|
||||
S.pickerComposite = null
|
||||
hidePickerTip()
|
||||
return
|
||||
}
|
||||
S.tool = (S.prevTool && S.prevTool !== 'picker') ? S.prevTool : 'brush'
|
||||
S.prevTool = null
|
||||
// 回到的若不是选择/形状类工具,选中态按 setTool 同一套规则清掉,避免画布残留选中框
|
||||
@@ -343,8 +350,27 @@ import { hexToRgb, rgbToHex } from '../vendor/image-math.js'
|
||||
renderObjects()
|
||||
}
|
||||
|
||||
/** 统一颜色应用:设置当前色 + 同步选中文字/形状颜色 */
|
||||
export function applyColorChange(color) {
|
||||
/**
|
||||
* PS 手感:画笔 / 橡皮下按住 Alt 临时变成吸管,松开 Alt 回到原工具。
|
||||
* 只在这两个绘制工具下生效;正在描笔时(isDrawing)不打断。
|
||||
* 取色后不退出吸管(见 exitPicker 的 altPicker 分支),可以按住 Alt 连续吸色。
|
||||
*/
|
||||
export function beginAltPicker() {
|
||||
if (S.altPicker) return
|
||||
if (S.tool !== 'brush' && S.tool !== 'eraser') return
|
||||
if (S.isDrawing) return
|
||||
S.altPicker = true
|
||||
setTool('picker') // setTool 会把原工具存进 prevTool,松开 Alt 时用它还原
|
||||
}
|
||||
|
||||
/** 松开 Alt / 窗口失焦:结束临时吸管并回到原工具 */
|
||||
export function endAltPicker() {
|
||||
if (!S.altPicker) return
|
||||
S.altPicker = false
|
||||
exitPicker()
|
||||
}
|
||||
|
||||
/** 统一颜色应用:设置当前色 + 同步选中文字/形状颜色 */ export function applyColorChange(color) {
|
||||
S.color = color
|
||||
updateColorUI()
|
||||
const t = getSelectedText()
|
||||
@@ -365,6 +391,8 @@ import { hexToRgb, rgbToHex } from '../vendor/image-math.js'
|
||||
export function setTool(tool) {
|
||||
if (S.placingImage) cancelImagePlacement()
|
||||
commitTextInput()
|
||||
// 用户主动切到别的工具 = 放弃「按住 Alt 临时吸管」,否则松 Alt 会把工具抢回去
|
||||
if (tool !== 'picker') S.altPicker = false
|
||||
if (tool !== 'select' && tool !== 'pen') { S.penEditId = null; S.penDragPt = -1; S.penDragPending = null }
|
||||
if (tool === 'picker' && S.tool !== 'picker') S.prevTool = S.tool
|
||||
if (tool !== 'pen') S.penPath = null
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
id: 'image-annotate',
|
||||
name: '标注 / 修图',
|
||||
version: '1.2.11',
|
||||
version: '1.2.12',
|
||||
apiVersion: 1,
|
||||
capabilities: ['commands', 'nodeActions', 'canvas', 'canvasWrite'],
|
||||
settings: {
|
||||
@@ -39,6 +39,8 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
// 画笔透明度 0.05~1(一笔整体透明度,笔划内不叠加)
|
||||
prevTool: null,
|
||||
// 吸管工具激活前的工具(取色后切回)
|
||||
altPicker: false,
|
||||
// 按住 Alt 的临时吸管(画笔/橡皮下),松开 Alt 回到原工具
|
||||
pickerComposite: null,
|
||||
// 吸管取样用的合成画布缓存(切工具/画布变化时失效)
|
||||
rectFill: false,
|
||||
@@ -709,6 +711,11 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
if (tip) tip.style.display = "none";
|
||||
}
|
||||
function exitPicker() {
|
||||
if (S.altPicker) {
|
||||
S.pickerComposite = null;
|
||||
hidePickerTip();
|
||||
return;
|
||||
}
|
||||
S.tool = S.prevTool && S.prevTool !== "picker" ? S.prevTool : "brush";
|
||||
S.prevTool = null;
|
||||
const back = S.tool;
|
||||
@@ -728,6 +735,18 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
}
|
||||
renderObjects();
|
||||
}
|
||||
function beginAltPicker() {
|
||||
if (S.altPicker) return;
|
||||
if (S.tool !== "brush" && S.tool !== "eraser") return;
|
||||
if (S.isDrawing) return;
|
||||
S.altPicker = true;
|
||||
setTool("picker");
|
||||
}
|
||||
function endAltPicker() {
|
||||
if (!S.altPicker) return;
|
||||
S.altPicker = false;
|
||||
exitPicker();
|
||||
}
|
||||
function applyColorChange(color) {
|
||||
S.color = color;
|
||||
updateColorUI();
|
||||
@@ -747,6 +766,7 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
function setTool(tool) {
|
||||
if (S.placingImage) cancelImagePlacement();
|
||||
commitTextInput();
|
||||
if (tool !== "picker") S.altPicker = false;
|
||||
if (tool !== "select" && tool !== "pen") {
|
||||
S.penEditId = null;
|
||||
S.penDragPt = -1;
|
||||
@@ -2786,9 +2806,9 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
<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="画笔 (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 active" data-tool="brush" title="画笔 (B):] 增大 / [ 减小笔刷;按住 Alt 临时吸色"><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="橡皮 (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="eraser" title="橡皮 (E):] 增大 / [ 减小笔刷;擦除当前活跃图层,与画笔共用大小/硬度/透明度;按住 Alt 临时吸色"><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="钢笔 (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>
|
||||
|
||||
@@ -4278,6 +4298,7 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
updateCursor();
|
||||
}
|
||||
S._shiftDown = false;
|
||||
endAltPicker();
|
||||
});
|
||||
bindIf(".iwb-editor-modal", "mousedown", (e) => e.stopPropagation());
|
||||
}
|
||||
@@ -4488,6 +4509,11 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
}
|
||||
}
|
||||
if (e.key === "Shift") S._shiftDown = true;
|
||||
if (e.key === "Alt" && !e.ctrlKey && !e.metaKey) {
|
||||
e.preventDefault();
|
||||
beginAltPicker();
|
||||
return;
|
||||
}
|
||||
if (e.key === "Enter" && S.tool === "pen" && S.penPath) {
|
||||
e.preventDefault();
|
||||
commitPenPath();
|
||||
@@ -4711,6 +4737,7 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
}
|
||||
function onKeyup(e) {
|
||||
if (e.key === "Shift") S._shiftDown = false;
|
||||
if (e.key === "Alt") endAltPicker();
|
||||
if (e.code === "Space" && S.spaceDown) {
|
||||
S.spaceDown = false;
|
||||
updateCursor();
|
||||
@@ -6185,6 +6212,8 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
var __debug = () => ({
|
||||
open: S.open,
|
||||
tool: S.tool,
|
||||
color: S.color,
|
||||
altPicker: !!S.altPicker,
|
||||
doc: { w: S.imgW, h: S.imgH },
|
||||
zoom: S.zoom,
|
||||
fit: { w: Math.round(S.fitW || 0), h: Math.round(S.fitH || 0) },
|
||||
|
||||
@@ -96,7 +96,7 @@ const boot = await page.evaluate((png) => {
|
||||
window.__commands['annotate-selected'].run().catch(() => {})
|
||||
return { version: window.__manifest.version, settingsSchema: Object.keys(window.__manifest.settings || {}) }
|
||||
}, PNG)
|
||||
check('产物可执行(循环打包未炸)', boot.version === '1.2.11', 'version=' + boot.version)
|
||||
check('产物可执行(循环打包未炸)', boot.version === '1.2.12', 'version=' + boot.version)
|
||||
check('manifest 声明输出预设设置项', boot.settingsSchema.includes('exportPreset') && boot.settingsSchema.includes('panelsCollapsed'), boot.settingsSchema.join(','))
|
||||
|
||||
await page.locator('#iwb-editor-overlay').waitFor({ state: 'visible', timeout: 15000 })
|
||||
@@ -904,6 +904,28 @@ check('画笔选项栏:推荐大小只留 4 个快捷点,硬度补 5 个快
|
||||
return ok
|
||||
})())
|
||||
|
||||
// 按住 Alt 临时吸色(PS 手感):画笔下按住 Alt → 吸管 → 取色 → 松开回画笔
|
||||
check('画笔按住 Alt 临时吸色,松开 Alt 回到画笔(可连续取色)', await (async () => {
|
||||
await page.locator('.iwb-editor-tool[data-tool="brush"]').click()
|
||||
const color0 = (await dbg()).color
|
||||
await page.keyboard.down('Alt')
|
||||
const d1 = await dbg()
|
||||
if (d1.tool !== 'picker' || !d1.altPicker) return 'down: tool=' + d1.tool + ' alt=' + d1.altPicker
|
||||
// 取色:点画面右下角(实色区)
|
||||
await page.mouse.click(liveBox.x + liveBox.width * 0.8, liveBox.y + liveBox.height * 0.85)
|
||||
await page.waitForTimeout(120)
|
||||
const d2 = await dbg()
|
||||
// 取色后仍停在吸管(Alt 还按着),颜色已变
|
||||
if (d2.tool !== 'picker') return 'pick: tool=' + d2.tool
|
||||
if (d2.color === color0) return 'pick: color 未变 ' + d2.color
|
||||
await page.keyboard.up('Alt')
|
||||
await page.waitForTimeout(180)
|
||||
const d3 = await dbg()
|
||||
return d3.tool === 'brush' && !d3.altPicker
|
||||
? true
|
||||
: 'up: tool=' + d3.tool + ' alt=' + d3.altPicker
|
||||
})())
|
||||
|
||||
// Shift+X:选中形状切 描边/实心(PS 风格,用户裁定 2026-11-04 晚)
|
||||
|
||||
// 图层快捷键:Ctrl+]/[ 上/下移、Ctrl+Shift+]/[ 置顶/置底、Alt+]/[ 选层、Delete 删图层
|
||||
@@ -952,10 +974,12 @@ check('图层 PS 快捷键:Alt+[/] 向下/向上选择图层', await (async ()
|
||||
})())
|
||||
|
||||
check('Delete 删除选中的位图图层(PS 习惯)', await (async () => {
|
||||
const before = (await dbg()).layers.length
|
||||
const d0 = await dbg()
|
||||
const before = d0.layers.length
|
||||
await page.keyboard.press('Delete')
|
||||
const d = await dbg()
|
||||
return d.layers.length === before - 1 && d.selectedLayerId === null
|
||||
if (d.layers.length !== before - 1) return 'layers ' + before + '→' + d.layers.length + ' sel=' + d0.selectedLayerId + ' selShape=' + d0.selectedShapeId + ' tool=' + d0.tool + ' toast=' + await page.locator('.iwb-editor-toast').textContent()
|
||||
return d.selectedLayerId === null ? true : 'sel 未清空: ' + d.selectedLayerId
|
||||
})())
|
||||
|
||||
check('无选中时 Ctrl+] 有 toast 提示(不再无声失败)', await (async () => {
|
||||
|
||||
Reference in new issue
Block a user