Compare commits

...
Author SHA1 Message Date
qiqi d16e68bfa9 feat(image-annotate): v1.20.0 去色下移为常用色第一格 + 头部控件全部定宽(不再被 flex 抵掉)
- 去色:头部按钮 → 常用色网格第一格(20px 同尺寸、虚线圆 + 斜圈)
- 不可用上下文(文字色 / 未闭合钢笔)不再 hidden,改 disabled + 42% 不透明度,title 说明原因
- 头部定宽:色值框 flex 0 0 124px(原 0 1 150)、加「底色」tab 后色值框与图钉位置不动
- 常用色 16 → 15(亮紫让位,深紫保留),去色 + 15 = 8 列 2 行
- 删掉 :has(...[hidden]) 隐藏竖线的规则,头部结构变纯静态
- harness 231 项 / 真站 e2e 40 项
2026-11-10 07:54:32 +08:00
qiqi 00a2699e89 docs(image-annotate): README 补 v1.19.0 章节 2026-11-10 07:33:04 +08:00
8 changed files with 207 additions and 109 deletions

No files matched your search

+36 -1
View File
@@ -234,6 +234,39 @@ P 下双击 = 结束当前路径(`commitPenPath`),不再进节点编辑。
- 文字 / 形状 / 钢笔会被直接栅格化进结果层(PS 合并矢量层也是这个结果)。 - 文字 / 形状 / 钢笔会被直接栅格化进结果层(PS 合并矢量层也是这个结果)。
- 结果层落回「原最低参与层」的位置,`assignLayerZ` 重新连续编号,不产生重复 z。 - 结果层落回「原最低参与层」的位置,`assignLayerZ` 重新连续编号,不产生重复 z。
## v1.20.0:去色下移成常用色第一格 / 头部全部定宽,不再被自动布局抵掉
用户截图反馈:「如果是文本元素的时候,就会把那个去色按钮给丢掉…可以让这些颜色选项一直保持在上面,
只是说不可用的时候是灰色。那个吸色、去色,数值框可以就固定了,避免自动布局给它抵掉」,
随后补一句「或者你把去色按钮放在常用颜色的第一个」。
**根因**:头部一行本来就是「3 个 tab + 竖线 + 吸管 + 色值 + 去色 + 图钉」,440px 的面板里
content 只有 416px,文字工具多出「底色」tab 时已经超出 3px —— 色值框当时是 `flex: 0 1 150px`,
自己缩到 147 顶着,再去掉一份宽度,`去色` 就被 flex 压没了(不是被 `hidden` 藏起来的)。
**做法(两条一起做,正好互相成全)**:
```
[文字●][描边●][底色●] │ ⌖ [ #2F6FED ] │ 📌
常用色 [⊘][🔴][🟠][🟡][🟢][🟩][🔵][🩷]
[⚪][⚫灰][⚫][🟥][🟩][🟦][🟪] ← 去色 = 第一格,永远在
```
- **去色 = 常用色网格第一格**(20px 圆、虚线边框 + 斜圈图标、间距跟色块完全一致)。
位置永远固定,切到文字色 / 未闭合钢笔这类「去掉就等于删对象」的上下文——
**不再 hidden,改成 `disabled` + 32%→42% 不透明度**,title 写明原因
(「去色不可用:文字色去掉就等于把文字删了」),hover 反馈也随 `:disabled` 关掉。
- **头部元素全部定宽**:色值框 `flex: 0 0 124px`(原来是可缩的 150px)、吸管 26、图钉 24、tab 不可压缩。
加上「底色」tab 后色值框宽度与图钉右边缘**一格像素都不动**,harness 有专门的回归断言
(`hexW: [124,124]`、`pinR: [762,762]`)。
- 常用色 16 → 15(亮紫 `#aa44ff` 让位给去色第一格,深紫 `#6b4fbb` 还在),
去色 + 15 色正好仍是 8 列 × 2 行,不出现第 3 行孤零零一个色块。
- 删掉 `:has(> .iwb-color-pop-none[hidden]) > .iwb-color-pop-bar { display: none }`:
去色不再隐藏,竖线也就没有「悬空」问题,头部结构变成纯静态。
测试:harness 231 项(新增「去色是第一格 / 加底色 tab 后头部纹丝不动 / 文字色下去色置灰」3 条,
另有 4 条旧断言从看 `.hidden` 改成看 `.disabled`);真站 e2e 40 项(改为校验 `noneFirst` + 15 色)。
## v1.19.0:右栏调色模块退场 / 头部一行装完 / 常用色 16 个 + 最近两排 ## v1.19.0:右栏调色模块退场 / 头部一行装完 / 常用色 16 个 + 最近两排
用户一段话:「右边栏的调色模块就可以去掉了,然后还去一个去色按钮,可以放在钉住按钮的左边, 用户一段话:「右边栏的调色模块就可以去掉了,然后还去一个去色按钮,可以放在钉住按钮的左边,
@@ -256,9 +289,11 @@ P 下双击 = 结束当前路径(`commitPenPath`),不再进节点编辑。
对描边/填充/底色都生效,title 随当前槽变。 对描边/填充/底色都生效,title 随当前槽变。
- 没有可去色的上下文(没选中对象、文字色这种单槽)时它本来就隐藏,**它前面那条竖线跟着一起藏** - 没有可去色的上下文(没选中对象、文字色这种单槽)时它本来就隐藏,**它前面那条竖线跟着一起藏**
(`:has(> .iwb-color-pop-none[hidden])`),否则头部右侧会留一截悬空的「||」。 (`:has(> .iwb-color-pop-none[hidden])`),否则头部右侧会留一截悬空的「||」。
> v1.20 已推翻:隐藏 ⇒ 置灰 disabled,且整颗下移到常用色第一格(见上一节)。
- 「去色 | 图钉」整组用 `margin-left: auto` 贴最右,色值框固定 150px 不被拉成长条 - 「去色 | 图钉」整组用 `margin-left: auto` 贴最右,色值框固定 150px 不被拉成长条
(拉长后视觉重心全跑到输入框上,色块反倒成了配角)。tab 加 `flex: 0 0 auto; white-space: nowrap`—— (拉长后视觉重心全跑到输入框上,色块反倒成了配角)。tab 加 `flex: 0 0 auto; white-space: nowrap`——
宽度不够时该缩的是色值框,不是把「描边」压成竖排两个字。 宽度不够时该缩的是色值框,不是把「描边」压成竖排两个字。
> v1.20 已改:色值框收紧到定宽 124px 且不再可缩 —— 就是「该缩的是色值框」这条把去色缩没了。
**3) 色块 8 列 × 2 行,常用色 12 → 16,最近色 6 → 16。** **3) 色块 8 列 × 2 行,常用色 12 → 16,最近色 6 → 16。**
@@ -279,7 +314,7 @@ P 下双击 = 结束当前路径(`commitPenPath`),不再进节点编辑。
- **分隔线从 `#313244` 提到 `#3b3b4e`**。没有小标题时,这条线是唯一能看出「常用 / 最近」分界的东西, - **分隔线从 `#313244` 提到 `#3b3b4e`**。没有小标题时,这条线是唯一能看出「常用 / 最近」分界的东西,
按原色画在深底上几乎看不见。 按原色画在深底上几乎看不见。
**验证**:harness 229 项、真站 e2e 见下。新增 harness 断言:头部四个控件同一水平线 + 去色在图钉左边 + **验证**:harness 229 项、真站 e2e 40 项全绿。新增 harness 断言:头部四个控件同一水平线 + 去色在图钉左边 +
两者之间有竖线 + 三 tab(文字工具)时头部不横向溢出、常用色 16 个严格 8 列 2 行、最近色网格 8 列 2 排、 两者之间有竖线 + 三 tab(文字工具)时头部不横向溢出、常用色 16 个严格 8 列 2 行、最近色网格 8 列 2 排、
弹层宽高区间、右栏第一个模块是「图片调节」且无 `[data-color-surface]`。 弹层宽高区间、右栏第一个模块是「图片调节」且无 `[data-color-surface]`。
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@iwb-plugin/image-annotate", "name": "@iwb-plugin/image-annotate",
"private": true, "private": true,
"version": "1.19.0", "version": "1.20.0",
"description": "IWB 插件:图片标注 / 修图(编辑器移植自 iwb-plaus 扩展,纯 Canvas 2D)", "description": "IWB 插件:图片标注 / 修图(编辑器移植自 iwb-plaus 扩展,纯 Canvas 2D)",
"ibwPlugin": { "ibwPlugin": {
"id": "image-annotate", "id": "image-annotate",
+30 -20
View File
@@ -1804,12 +1804,8 @@
/* 竖线:分隔「调哪个槽 / 取色工具 / 去色·钉住」三组,比空白更清楚,又不加边框重量 */ /* 竖线:分隔「调哪个槽 / 取色工具 / 去色·钉住」三组,比空白更清楚,又不加边框重量 */
.iwb-color-pop-bar { width: 1px; height: 16px; background: #313244; flex: 0 0 auto; } .iwb-color-pop-bar { width: 1px; height: 16px; background: #313244; flex: 0 0 auto; }
/* 「去色 | 图钉」整组贴最右(margin-left:auto)。这样色值框不用拉成一条长条去填空, /* 「去色 | 图钉」整组贴最右(margin-left:auto)。这样色值框不用拉成一条长条去填空,
头部是「左边调色槽与工具 / 右边两个开关」两段式,扫视时不会把 HEX 当成主角。 */ 头部是「左边调色槽与工具 / 右边一个开关」两段式,扫视时不会把 HEX 当成主角。 */
.iwb-color-pop-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: 0 0 auto; } .iwb-color-pop-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
/* 没有可去色的上下文(未选中对象 / 文字色这种单槽)时「去色」是隐藏的,
它前面那条竖线要一起藏掉,否则头部右侧会留下一截悬空的「||」;
两条都藏掉后整组只剩图钉,竖线也不再夹在「色值 | 图钉」之间显得多余 */
.iwb-color-pop-tools:has(> .iwb-color-pop-none[hidden]) > .iwb-color-pop-bar { display: none; }
.iwb-color-pop-tab { .iwb-color-pop-tab {
display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px;
@@ -1832,16 +1828,28 @@
background-image: linear-gradient(135deg, transparent calc(50% - 1px), #f38ba8 calc(50% - 1px), #f38ba8 calc(50% + 1px), transparent calc(50% + 1px)); background-image: linear-gradient(135deg, transparent calc(50% - 1px), #f38ba8 calc(50% - 1px), #f38ba8 calc(50% + 1px), transparent calc(50% + 1px));
} }
.iwb-color-pop-tab[hidden] { display: none; } .iwb-color-pop-tab[hidden] { display: none; }
/* 去色(v1.19):原来的「无」改名挪位。虚线框 + 红斜圈,和「实心色块」区分开; /* 去色(v1.20,用户 2026-11-10):头部那颗带文字的按钮下移到「常用色第一格」,
它是开关不是色块,所以不用填充色表达状态,只换边框/文字色。 */ 尺寸、间距跟色块完全一致(20px 圆),只是画虚线边框 + 斜圈图标 ——
它是开关不是色块,所以不用填充色表达状态,只换边框/图标色。
永远显示(不可用时不 hidden,只 disabled + 变灰),位置才记得住、头部也不重排。 */
.iwb-color-pop-none { .iwb-color-pop-none {
flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
border: 1px dashed #585b70; border-radius: 7px; background: transparent; color: #a6adc8; width: 20px; height: 20px; padding: 0; margin: 0; box-sizing: border-box;
font: 500 11.5px/1 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; cursor: pointer; border: 1px dashed #585b70; border-radius: 50%; background: transparent; color: #a6adc8;
cursor: pointer; transition: transform 0.08s ease, border-color 0.12s ease, color 0.12s ease;
}
.iwb-color-pop-none svg { flex: 0 0 auto; width: 12px; height: 12px; }
/* hover 只对可用态生效:disabled 时不该有放大反馈,否则看着像能点 */
.iwb-color-pop-none:not(:disabled):hover { border-color: #f38ba8; color: #f38ba8; transform: scale(1.14); }
.iwb-color-pop-none.active { border-style: solid; border-color: #f38ba8; color: #f38ba8; background: rgba(243, 139, 168, 0.14); }
/* 不可用:整颗压到 42% 不透明度 —— 灰到能看出「这里有个去色,但现在用不上」,
但不至于淡到看不见(32% 时在深底上几乎消失,等于又变成了「消失」,只是慢一点)。
cursor 保持 default,不给 pointer。 */
.iwb-color-pop-none:disabled,
.iwb-color-pop-none.is-disabled {
opacity: 0.42; cursor: default; color: #8b8fa8; border-color: #4a4a5e;
background: transparent; transform: none;
} }
.iwb-color-pop-none svg { flex: 0 0 auto; }
.iwb-color-pop-none:hover { border-color: #f38ba8; color: #f38ba8; }
.iwb-color-pop-none.active { border-style: solid; border-color: #f38ba8; color: #f38ba8; background: rgba(243, 139, 168, 0.12); }
.iwb-color-pop-none[hidden] { display: none; } .iwb-color-pop-none[hidden] { display: none; }
.iwb-color-pop-body { display: flex; align-items: stretch; gap: 10px; } .iwb-color-pop-body { display: flex; align-items: stretch; gap: 10px; }
.iwb-color-pop-picker { display: flex; gap: 8px; flex: 0 0 auto; } .iwb-color-pop-picker { display: flex; gap: 8px; flex: 0 0 auto; }
@@ -1870,11 +1878,12 @@
/* display:flex 会盖掉 [hidden] 的默认 display:none,必须显式写一条 */ /* display:flex 会盖掉 [hidden] 的默认 display:none,必须显式写一条 */
.iwb-color-group[hidden] { display: none; } .iwb-color-group[hidden] { display: none; }
/* 色值输入固定 150px:够显示 #RRGGBB 还有余量,又不会被 flex-grow 拉成一条长条 /* 色值输入定宽 124(v1.20 由 150 收窄、且不再可缩):#RRGGBB 七个字符 55px 出够,
(拉长后视觉重心全跑到输入框上,色块反倒成了配角)。 v1.19 用的是 flex:0 1 150px,文字工具多出「底色」tab 时它会自己缩到 147 ——
文字工具多出「底色」tab 时按 0 1 150 自动收缩,min-width 保证七个字符看得全。 */ 头部宽度就跟着上下文抖,最后把「去色」整颗挤掉(用户截图里那次)。
现在头部每个元素都定宽:只有 gap 吸收亚像素误差,切工具不再重排。 */
.iwb-editor-color-pop .iwb-editor-color-hex-input { .iwb-editor-color-pop .iwb-editor-color-hex-input {
flex: 0 1 150px; width: 150px; min-width: 58px; height: 26px; padding: 0 5px; text-align: center; flex: 0 0 124px; width: 124px; height: 26px; padding: 0 5px; text-align: center;
font: 600 12px monospace; border-radius: 6px; box-sizing: border-box; font: 600 12px monospace; border-radius: 6px; box-sizing: border-box;
} }
.iwb-editor-color-pop .iwb-editor-color-swatches { .iwb-editor-color-pop .iwb-editor-color-swatches {
@@ -2248,7 +2257,8 @@
#iwb-editor-overlay .iwb-editor-left .iwb-editor-zoom .iwb-editor-zoom-val, #iwb-editor-overlay .iwb-editor-left .iwb-editor-zoom .iwb-editor-zoom-val,
#iwb-editor-overlay .iwb-editor-left .iwb-editor-zoom .iwb-editor-zoom-fit { font-size: 12px; } #iwb-editor-overlay .iwb-editor-left .iwb-editor-zoom .iwb-editor-zoom-fit { font-size: 12px; }
/* 调色面板本体 */ /* 调色面板本体(v1.20:去色已下移到色块网格,这里只剩 tab 需要放大字号;
#iwb-editor-overlay .iwb-color-pop-tab, 去色是 20px 格子,高度必须跟色块一致,别被这条统一字号的规则顶成 26px) */
#iwb-editor-overlay .iwb-color-pop-none { font-size: 12.5px; height: 26px; } #iwb-editor-overlay .iwb-color-pop-tab { font-size: 12.5px; height: 26px; }
#iwb-editor-overlay .iwb-color-pop-none { width: 20px; height: 20px; }
#iwb-editor-overlay .iwb-editor-color-pop .iwb-editor-color-hex-input { font-size: 13px; } #iwb-editor-overlay .iwb-editor-color-pop .iwb-editor-color-hex-input { font-size: 13px; }
+18 -12
View File
@@ -17,20 +17,28 @@ import { bindEvents } from './events.js'
* HEX 回填、常用色/最近色的 active 圈),events.js#updateColorUI 按 * HEX 回填、常用色/最近色的 active 圈),events.js#updateColorUI 按
* `[data-color-surface]` 逐个刷 —— 留着这层抽象,将来若再加一处面板不用重写联动。 * `[data-color-surface]` 逐个刷 —— 留着这层抽象,将来若再加一处面板不用重写联动。
*/ */
/* 16 个常用色 = 色板里 8 列 × 2 行(v1.19)。 /* 15 个常用色 + 第一格「去色」= 色板里 8 列 × 2 行(v1.20)。
排布刻意成对:第一行是 8 个饱和亮色(红橙黄绿青蓝紫粉), 排布刻意成对:第一行是 7 个饱和亮色(红橙黄绿青蓝粉)+ 去色打头,
第二行是 4 个中性色(白/浅灰/中灰/黑)+ 4 个同色系「深一档」, 第二行是 4 个中性色(白/浅灰/中灰/黑)+ 4 个同色系「深一档」,
深红/深绿/深蓝/深紫 在浅色底图上比亮色稳,做描边不刺眼。 */ 深红/深绿/深蓝/深紫 在浅色底图上比亮色稳,做描边不刺眼。
亮紫 #aa44ff 让位给第一格的「去色」(v1.20,用户 2026-11-10:去色放常用色第一个)——
紫色还留着深一档的 #6b4fbb,色相不缺,8×2 的网格也不用改成 3 行。 */
const COMMON_COLORS = [ const COMMON_COLORS = [
'#ff4444', '#ff8a00', '#ffd400', '#4cd964', '#00bfa5', '#4488ff', '#aa44ff', '#ff66aa', '#ff4444', '#ff8a00', '#ffd400', '#4cd964', '#00bfa5', '#4488ff', '#ff66aa',
'#ffffff', '#d0d0d0', '#808080', '#000000', '#c0392b', '#0f9d58', '#1677ff', '#6b4fbb' '#ffffff', '#d0d0d0', '#808080', '#000000', '#c0392b', '#0f9d58', '#1677ff', '#6b4fbb'
] ]
/** 色板面板(v1.19 起只有工具栏弹层一份,右栏常驻面板已删) /** 色板面板(v1.19 起只有工具栏弹层一份,右栏常驻面板已删)
* *
* 头部一行:调哪个槽(描边/填充/底色)│ 吸管 + 色值 │ 去色 │ 图钉 * 头部一行:调哪个槽(描边/填充/底色)│ 吸管 + 色值 │ 图钉
* 把「吸管 + 色值」提到头部,是为了让下面整块高度都留给色块: * 把「吸管 + 色值」提到头部,是为了让下面整块高度都留给色块:
* 常用色 2 排 + 最近色 2 排,一屏就能点到,不用滚动、也不用二次点开。 * 常用色 2 排 + 最近色 2 排,一屏就能点到,不用滚动、也不用二次点开。
*
* v1.20(用户 2026-11-10):头部不再随上下文增减控件。
* 原因是文字工具会多出「底色」tab,头部一行本来就贴着 440 的极限,
* 再去掉/加上「去色」就会把色值框和吸管挤变形(甚至整颗按钮被 flex 抵没)。
* 现在「去色」下移到常用色网格的第一格 —— 位置永远固定,不可用时只是变灰 + disabled,
* 头部元素因此全是定宽,切工具时头部不再重排。
*/ */
function colorSurfaceHtml() { function colorSurfaceHtml() {
return ` return `
@@ -41,14 +49,7 @@ import { bindEvents } from './events.js'
<span class="iwb-color-pop-bar"></span> <span class="iwb-color-pop-bar"></span>
<button type="button" class="iwb-editor-color-eye" data-action="palettePick" title="吸色:切到吸管工具,在画布上点一下取色"><svg width="13" height="13" 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 type="button" class="iwb-editor-color-eye" data-action="palettePick" title="吸色:切到吸管工具,在画布上点一下取色"><svg width="13" height="13" 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>
<input class="iwb-editor-color-hex-input" value="#ff4444" maxlength="7" spellcheck="false" autocomplete="off" title="十六进制颜色,回车生效"> <input class="iwb-editor-color-hex-input" value="#ff4444" maxlength="7" spellcheck="false" autocomplete="off" title="十六进制颜色,回车生效">
<!-- 去色(v1.19,用户 2026-11-10):就是原来的「无」,挪到图钉左边并用竖线隔开。
调色时「这一项我不上色」和「钉住」都是随手要按的开关,放在同一侧最顺。
对描边 / 填充 / 底色都生效,具体含义随当前槽变(见 updateColorUI 的 title)。
外面这层 .iwb-color-pop-tools 用 margin-left:auto 把整组推到最右:
色值框因此不会被拉成一整条(见 CSS 的 max-width)。 -->
<span class="iwb-color-pop-tools"> <span class="iwb-color-pop-tools">
<span class="iwb-color-pop-bar"></span>
<button type="button" class="iwb-color-pop-none" data-color-none="1" title="去色:当前这一项不上色(描边/填充/底色按上下文透明)"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="m5.6 5.6 12.8 12.8"/></svg>去色</button>
<span class="iwb-color-pop-bar"></span> <span class="iwb-color-pop-bar"></span>
<!-- 钉住(v1.18,用户 2026-11-10):调色常常要连着改好几处,每次点开色板太碎。 <!-- 钉住(v1.18,用户 2026-11-10):调色常常要连着改好几处,每次点开色板太碎。
钉住后点画布 / 点别处都不收起,只有再点一次图钉、按 Esc、或点吸管才收。 钉住后点画布 / 点别处都不收起,只有再点一次图钉、按 Esc、或点吸管才收。
@@ -69,6 +70,11 @@ import { bindEvents } from './events.js'
<div class="iwb-color-group"> <div class="iwb-color-group">
<span class="iwb-color-group-label">常用色</span> <span class="iwb-color-group-label">常用色</span>
<div class="iwb-editor-color-swatches"> <div class="iwb-editor-color-swatches">
<!-- 去色(v1.20,用户 2026-11-10):原来是头部一颗带文字的按钮,现在占常用色第一格。
好处有二:① 位置永远固定,切到文字/箭头这类「去不掉色」的上下文只是变灰,
不会整颗消失;② 头部腾出一颗按钮的宽度,文字工具多出「底色」tab 也挤不坏色值框。
含义随当前槽变(无描边 / 无填充 / 无底色),title 在 updateColorUI 里刷。 -->
<button type="button" class="iwb-color-pop-none" data-color-none="1" title="去色:当前这一项不上色(描边/填充/底色按上下文透明)"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="m5.6 5.6 12.8 12.8"/></svg></button>
${COMMON_COLORS.map(c => `<button type="button" class="iwb-editor-color-panel-swatch" data-panel-color="${c}" style="background:${c}" title="${c}"></button>`).join('')} ${COMMON_COLORS.map(c => `<button type="button" class="iwb-editor-color-panel-swatch" data-panel-color="${c}" style="background:${c}" title="${c}"></button>`).join('')}
</div> </div>
</div> </div>
+15 -8
View File
@@ -1055,21 +1055,28 @@ import { hexToRgb, parseRatio, rgbToHex } from '../vendor/image-math.js'
// 描边格:文字的「描边」是第二格(上面已处理),文字色/单槽上下文不允许「无」 // 描边格:文字的「描边」是第二格(上面已处理),文字色/单槽上下文不允许「无」
if (!isFill && !isBg) tab.classList.toggle('is-none', !isText && sl.strokeOn === false) if (!isFill && !isBg) tab.classList.toggle('is-none', !isText && sl.strokeOn === false)
}) })
// 「去色」(v1.19 前叫「无」):形状/钢笔 = 无描边或无填充;文字描边 = 描边宽度 0;文字底色 = 关掉底色块 // 「去色」:形状/钢笔 = 无描边或无填充;文字描边 = 描边宽度 0;文字底色 = 关掉底色块
// (文字色与箭头单槽没有「去色」—— 去掉就等于把对象删了,不该给这个按钮) // v1.20(用户 2026-11-10):它现在是常用色网格的第一格,**永远显示**。
// 按集合刷(原来是右栏 + 弹层各一个,现在只剩弹层一个,写法保持不变以免将来再加面板时漏刷) // 文字色 / 箭头这类「去掉就等于删掉对象」的上下文,改成置灰 + disabled,而不是整颗消失 ——
// 消失会让色板每切一次工具就重排一次,位置记不住。
const onBg = S.colorTarget === 'bg' && isText const onBg = S.colorTarget === 'bg' && isText
const onFill = S.colorTarget === 'fill' && second const onFill = S.colorTarget === 'fill' && second
const onStroke = S.colorTarget === 'stroke' && !isText && strokeSlotCanBeNone() const onStroke = S.colorTarget === 'stroke' && !isText && strokeSlotCanBeNone()
const showNone = onBg || onFill || onStroke const noneUsable = onBg || onFill || onStroke
runtime.el.querySelectorAll('[data-color-none]').forEach(noneBtn => { runtime.el.querySelectorAll('[data-color-none]').forEach(noneBtn => {
noneBtn.hidden = !showNone noneBtn.hidden = false
noneBtn.classList.toggle('active', showNone && (onBg ? !sl.bgOn : (onFill ? !sl.fillOn : !sl.strokeOn))) noneBtn.disabled = !noneUsable
noneBtn.title = onBg noneBtn.classList.toggle('is-disabled', !noneUsable)
noneBtn.classList.toggle('active', noneUsable && (onBg ? !sl.bgOn : (onFill ? !sl.fillOn : !sl.strokeOn)))
noneBtn.title = noneUsable
? (onBg
? '去色:文字后面完全透明(无底色)' ? '去色:文字后面完全透明(无底色)'
: (onStroke : (onStroke
? (sl.strokeOn === false ? '当前已是无描边;点选颜色可恢复描边' : '去色:去掉形状外框,只留内部填充') ? (sl.strokeOn === false ? '当前已是无描边;点选颜色可恢复描边' : '去色:去掉形状外框,只留内部填充')
: (isText ? '去色:把描边宽度置 0,只留文字本身' : '去色:形状内部透明,只留描边')) : (isText ? '去色:把描边宽度置 0,只留文字本身' : '去色:形状内部透明,只留描边')))
: (isText && S.colorTarget === 'stroke'
? '去色不可用:文字色去掉就等于把文字删了,要隐藏文字请用「清空标注」'
: '去色不可用:这一格只有一种颜色,去掉就没有了')
}) })
const cur = activeColor() const cur = activeColor()
+13 -14
View File
@@ -9,7 +9,7 @@
var __IWB_ANNOTATE_MANIFEST__ = { var __IWB_ANNOTATE_MANIFEST__ = {
id: 'image-annotate', id: 'image-annotate',
name: '标注 / 修图', name: '标注 / 修图',
version: '1.19.0', version: '1.20.0',
apiVersion: 1, apiVersion: 1,
capabilities: ['commands', 'nodeActions', 'canvas', 'canvasWrite'], capabilities: ['commands', 'nodeActions', 'canvas', 'canvasWrite'],
settings: { settings: {
@@ -3506,7 +3506,6 @@ var __IWB_ANNOTATE_MANIFEST__ = {
"#4cd964", "#4cd964",
"#00bfa5", "#00bfa5",
"#4488ff", "#4488ff",
"#aa44ff",
"#ff66aa", "#ff66aa",
"#ffffff", "#ffffff",
"#d0d0d0", "#d0d0d0",
@@ -3526,14 +3525,7 @@ var __IWB_ANNOTATE_MANIFEST__ = {
<span class="iwb-color-pop-bar"></span> <span class="iwb-color-pop-bar"></span>
<button type="button" class="iwb-editor-color-eye" data-action="palettePick" title="吸色:切到吸管工具,在画布上点一下取色"><svg width="13" height="13" 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 type="button" class="iwb-editor-color-eye" data-action="palettePick" title="吸色:切到吸管工具,在画布上点一下取色"><svg width="13" height="13" 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>
<input class="iwb-editor-color-hex-input" value="#ff4444" maxlength="7" spellcheck="false" autocomplete="off" title="十六进制颜色,回车生效"> <input class="iwb-editor-color-hex-input" value="#ff4444" maxlength="7" spellcheck="false" autocomplete="off" title="十六进制颜色,回车生效">
<!-- 去色(v1.19,用户 2026-11-10):就是原来的「无」,挪到图钉左边并用竖线隔开。
调色时「这一项我不上色」和「钉住」都是随手要按的开关,放在同一侧最顺。
对描边 / 填充 / 底色都生效,具体含义随当前槽变(见 updateColorUI 的 title)。
外面这层 .iwb-color-pop-tools 用 margin-left:auto 把整组推到最右:
色值框因此不会被拉成一整条(见 CSS 的 max-width)。 -->
<span class="iwb-color-pop-tools"> <span class="iwb-color-pop-tools">
<span class="iwb-color-pop-bar"></span>
<button type="button" class="iwb-color-pop-none" data-color-none="1" title="去色:当前这一项不上色(描边/填充/底色按上下文透明)"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="m5.6 5.6 12.8 12.8"/></svg>去色</button>
<span class="iwb-color-pop-bar"></span> <span class="iwb-color-pop-bar"></span>
<!-- 钉住(v1.18,用户 2026-11-10):调色常常要连着改好几处,每次点开色板太碎。 <!-- 钉住(v1.18,用户 2026-11-10):调色常常要连着改好几处,每次点开色板太碎。
钉住后点画布 / 点别处都不收起,只有再点一次图钉、按 Esc、或点吸管才收。 钉住后点画布 / 点别处都不收起,只有再点一次图钉、按 Esc、或点吸管才收。
@@ -3554,6 +3546,11 @@ var __IWB_ANNOTATE_MANIFEST__ = {
<div class="iwb-color-group"> <div class="iwb-color-group">
<span class="iwb-color-group-label">常用色</span> <span class="iwb-color-group-label">常用色</span>
<div class="iwb-editor-color-swatches"> <div class="iwb-editor-color-swatches">
<!-- 去色(v1.20,用户 2026-11-10):原来是头部一颗带文字的按钮,现在占常用色第一格。
好处有二:① 位置永远固定,切到文字/箭头这类「去不掉色」的上下文只是变灰,
不会整颗消失;② 头部腾出一颗按钮的宽度,文字工具多出「底色」tab 也挤不坏色值框。
含义随当前槽变(无描边 / 无填充 / 无底色),title 在 updateColorUI 里刷。 -->
<button type="button" class="iwb-color-pop-none" data-color-none="1" title="去色:当前这一项不上色(描边/填充/底色按上下文透明)"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="m5.6 5.6 12.8 12.8"/></svg></button>
${COMMON_COLORS.map((c) => `<button type="button" class="iwb-editor-color-panel-swatch" data-panel-color="${c}" style="background:${c}" title="${c}"></button>`).join("")} ${COMMON_COLORS.map((c) => `<button type="button" class="iwb-editor-color-panel-swatch" data-panel-color="${c}" style="background:${c}" title="${c}"></button>`).join("")}
</div> </div>
</div> </div>
@@ -5459,11 +5456,13 @@ var __IWB_ANNOTATE_MANIFEST__ = {
const onBg = S.colorTarget === "bg" && isText; const onBg = S.colorTarget === "bg" && isText;
const onFill = S.colorTarget === "fill" && second; const onFill = S.colorTarget === "fill" && second;
const onStroke = S.colorTarget === "stroke" && !isText && strokeSlotCanBeNone(); const onStroke = S.colorTarget === "stroke" && !isText && strokeSlotCanBeNone();
const showNone = onBg || onFill || onStroke; const noneUsable = onBg || onFill || onStroke;
runtime.el.querySelectorAll("[data-color-none]").forEach((noneBtn) => { runtime.el.querySelectorAll("[data-color-none]").forEach((noneBtn) => {
noneBtn.hidden = !showNone; noneBtn.hidden = false;
noneBtn.classList.toggle("active", showNone && (onBg ? !sl.bgOn : onFill ? !sl.fillOn : !sl.strokeOn)); noneBtn.disabled = !noneUsable;
noneBtn.title = onBg ? "去色:文字后面完全透明(无底色)" : onStroke ? sl.strokeOn === false ? "当前已是无描边;点选颜色可恢复描边" : "去色:去掉形状外框,只留内部填充" : isText ? "去色:把描边宽度置 0,只留文字本身" : "去色:形状内部透明,只留描边"; noneBtn.classList.toggle("is-disabled", !noneUsable);
noneBtn.classList.toggle("active", noneUsable && (onBg ? !sl.bgOn : onFill ? !sl.fillOn : !sl.strokeOn));
noneBtn.title = noneUsable ? onBg ? "去色:文字后面完全透明(无底色)" : onStroke ? sl.strokeOn === false ? "当前已是无描边;点选颜色可恢复描边" : "去色:去掉形状外框,只留内部填充" : isText ? "去色:把描边宽度置 0,只留文字本身" : "去色:形状内部透明,只留描边" : isText && S.colorTarget === "stroke" ? "去色不可用:文字色去掉就等于把文字删了,要隐藏文字请用「清空标注」" : "去色不可用:这一格只有一种颜色,去掉就没有了";
}); });
const cur = activeColor(); const cur = activeColor();
let matchPreset = false; let matchPreset = false;
@@ -8984,7 +8983,7 @@ var __IWB_ANNOTATE_MANIFEST__ = {
}; };
// image-annotate/plugin/editor.css // image-annotate/plugin/editor.css
var editor_default = '/* IWB 鲜艺抠图节点 - 注入样式 */\n\n/* 抠图按钮 */\n.iwb-cutout-btn {\n cursor: pointer;\n opacity: 0.7;\n transition: opacity 0.15s, transform 0.15s;\n}\n\n.iwb-cutout-btn:hover {\n opacity: 1;\n transform: scale(1.15);\n}\n\n.iwb-cutout-btn svg {\n width: 14px;\n height: 14px;\n display: block;\n}\n\n/* 正在处理中的按钮状态 */\n.iwb-cutout-btn.processing {\n animation: iwb-cutout-pulse 1s infinite;\n pointer-events: none;\n}\n\n@keyframes iwb-cutout-pulse {\n 0%, 100% { opacity: 0.4; }\n 50% { opacity: 1; }\n}\n\n/* 全屏遮罩 */\n.iwb-cutout-overlay {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, 0.25);\n display: none;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n gap: 12px;\n z-index: 999999;\n pointer-events: all;\n backdrop-filter: blur(2px);\n}\n\n/* 自定义按钮提示(挂在 body,最高层级,不会被图片遮挡) */\n#iwb-cutout-tip {\n position: fixed;\n z-index: 2147483647;\n background: rgba(30, 30, 46, 0.95);\n color: #fff;\n padding: 5px 10px;\n border-radius: 6px;\n font-size: 12px;\n line-height: 1.5;\n white-space: nowrap;\n pointer-events: none;\n display: none;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);\n border: 1px solid rgba(255, 255, 255, 0.14);\n font-family: system-ui, -apple-system, "Segoe UI", sans-serif;\n max-width: 320px;\n white-space: normal;\n word-break: break-all;\n}\n\n/* 加载动画 */\n.iwb-cutout-spinner {\n width: 48px;\n height: 48px;\n border: 4px solid rgba(255, 255, 255, 0.3);\n border-top-color: #e8a735;\n border-radius: 50%;\n animation: iwb-cutout-spin 0.8s linear infinite;\n}\n\n@keyframes iwb-cutout-spin {\n to { transform: rotate(360deg); }\n}\n\n/* 遮罩文字 */\n.iwb-cutout-text {\n color: #fff;\n font-size: 14px;\n font-weight: 500;\n text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);\n background: rgba(0, 0, 0, 0.6);\n padding: 8px 16px;\n border-radius: 6px;\n}\n\n/* Toast 提示 */\n.iwb-cutout-toast {\n position: fixed;\n bottom: 24px;\n left: 50%;\n transform: translateX(-50%);\n padding: 10px 20px;\n border-radius: 8px;\n font-size: 13px;\n font-weight: 500;\n z-index: 999999;\n transition: opacity 0.3s;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n display: none;\n max-width: 400px;\n}\n\n.iwb-cutout-toast-success {\n background: #1a7f37;\n color: #fff;\n}\n\n.iwb-cutout-toast-error {\n background: #cf222e;\n color: #fff;\n}\n\n.iwb-cutout-toast-info {\n background: #1f6feb;\n color: #fff;\n}\n\n/* 白底按钮 */\n.iwb-whitebg-btn {\n cursor: pointer;\n opacity: 0.7;\n transition: opacity 0.15s, transform 0.15s;\n}\n.iwb-whitebg-btn:hover { opacity: 1; transform: scale(1.15); }\n.iwb-whitebg-btn svg { width: 14px; height: 14px; display: block; }\n.iwb-whitebg-btn.processing { animation: iwb-cutout-pulse 1s infinite; pointer-events: none; }\n\n/* 编辑按钮 */\n.iwb-editor-btn-icon {\n cursor: pointer;\n opacity: 0.7;\n transition: opacity 0.15s, transform 0.15s;\n}\n.iwb-editor-btn-icon:hover { opacity: 1; transform: scale(1.15); }\n.iwb-editor-btn-icon svg { width: 14px; height: 14px; display: block; }\n\n/* ==================== 图片编辑器 ==================== */\n\n.iwb-editor-overlay {\n position: fixed;\n top: 0; left: 0;\n width: 100%; height: 100%;\n background: rgba(0, 0, 0, 0.6);\n display: none;\n align-items: center;\n justify-content: center;\n z-index: 999998;\n backdrop-filter: blur(3px);\n}\n\n.iwb-editor-modal {\n background: #1e1e2e;\n border-radius: 0;\n box-shadow: none;\n display: flex;\n flex-direction: column;\n width: 100vw;\n height: 100vh;\n max-width: none;\n max-height: none;\n overflow: visible;\n}\n\n/* 新增:主区域(画布 + 图层面板)flex 布局 */\n.iwb-editor-main {\n display: flex;\n flex: 1 1 auto;\n min-height: 0;\n overflow: visible;\n}\n\n.iwb-editor-header {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 10px 16px;\n background: #181825;\n border-bottom: 1px solid #313244;\n flex-wrap: nowrap;\n}\n.iwb-editor-header > .iwb-editor-tools {\n position: absolute;\n left: 12px;\n top: 68px;\n width: 44px;\n flex-direction: column;\n padding: 6px;\n background: #181825;\n border: 1px solid #313244;\n border-radius: 8px;\n z-index: 20;\n}\n.iwb-editor-header > .iwb-editor-tools .iwb-editor-action { position: static; }\n.iwb-editor-header > .iwb-editor-tools .iwb-editor-action[data-action="undo"],\n.iwb-editor-header > .iwb-editor-tools .iwb-editor-action[data-action="redo"],\n.iwb-editor-header > .iwb-editor-tools .iwb-editor-action[data-action="reset"],\n.iwb-editor-header > .iwb-editor-tools .iwb-editor-action[data-action="restore"] {\n position: absolute;\n top: -54px;\n left: auto;\n}\n.iwb-editor-header > .iwb-editor-tools .iwb-editor-action[data-action="undo"] { right: 154px; }\n.iwb-editor-header > .iwb-edLine truncated var editor_default = '/* IWB 鲜艺抠图节点 - 注入样式 */\n\n/* 抠图按钮 */\n.iwb-cutout-btn {\n cursor: pointer;\n opacity: 0.7;\n transition: opacity 0.15s, transform 0.15s;\n}\n\n.iwb-cutout-btn:hover {\n opacity: 1;\n transform: scale(1.15);\n}\n\n.iwb-cutout-btn svg {\n width: 14px;\n height: 14px;\n display: block;\n}\n\n/* 正在处理中的按钮状态 */\n.iwb-cutout-btn.processing {\n animation: iwb-cutout-pulse 1s infinite;\n pointer-events: none;\n}\n\n@keyframes iwb-cutout-pulse {\n 0%, 100% { opacity: 0.4; }\n 50% { opacity: 1; }\n}\n\n/* 全屏遮罩 */\n.iwb-cutout-overlay {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, 0.25);\n display: none;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n gap: 12px;\n z-index: 999999;\n pointer-events: all;\n backdrop-filter: blur(2px);\n}\n\n/* 自定义按钮提示(挂在 body,最高层级,不会被图片遮挡) */\n#iwb-cutout-tip {\n position: fixed;\n z-index: 2147483647;\n background: rgba(30, 30, 46, 0.95);\n color: #fff;\n padding: 5px 10px;\n border-radius: 6px;\n font-size: 12px;\n line-height: 1.5;\n white-space: nowrap;\n pointer-events: none;\n display: none;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);\n border: 1px solid rgba(255, 255, 255, 0.14);\n font-family: system-ui, -apple-system, "Segoe UI", sans-serif;\n max-width: 320px;\n white-space: normal;\n word-break: break-all;\n}\n\n/* 加载动画 */\n.iwb-cutout-spinner {\n width: 48px;\n height: 48px;\n border: 4px solid rgba(255, 255, 255, 0.3);\n border-top-color: #e8a735;\n border-radius: 50%;\n animation: iwb-cutout-spin 0.8s linear infinite;\n}\n\n@keyframes iwb-cutout-spin {\n to { transform: rotate(360deg); }\n}\n\n/* 遮罩文字 */\n.iwb-cutout-text {\n color: #fff;\n font-size: 14px;\n font-weight: 500;\n text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);\n background: rgba(0, 0, 0, 0.6);\n padding: 8px 16px;\n border-radius: 6px;\n}\n\n/* Toast 提示 */\n.iwb-cutout-toast {\n position: fixed;\n bottom: 24px;\n left: 50%;\n transform: translateX(-50%);\n padding: 10px 20px;\n border-radius: 8px;\n font-size: 13px;\n font-weight: 500;\n z-index: 999999;\n transition: opacity 0.3s;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n display: none;\n max-width: 400px;\n}\n\n.iwb-cutout-toast-success {\n background: #1a7f37;\n color: #fff;\n}\n\n.iwb-cutout-toast-error {\n background: #cf222e;\n color: #fff;\n}\n\n.iwb-cutout-toast-info {\n background: #1f6feb;\n color: #fff;\n}\n\n/* 白底按钮 */\n.iwb-whitebg-btn {\n cursor: pointer;\n opacity: 0.7;\n transition: opacity 0.15s, transform 0.15s;\n}\n.iwb-whitebg-btn:hover { opacity: 1; transform: scale(1.15); }\n.iwb-whitebg-btn svg { width: 14px; height: 14px; display: block; }\n.iwb-whitebg-btn.processing { animation: iwb-cutout-pulse 1s infinite; pointer-events: none; }\n\n/* 编辑按钮 */\n.iwb-editor-btn-icon {\n cursor: pointer;\n opacity: 0.7;\n transition: opacity 0.15s, transform 0.15s;\n}\n.iwb-editor-btn-icon:hover { opacity: 1; transform: scale(1.15); }\n.iwb-editor-btn-icon svg { width: 14px; height: 14px; display: block; }\n\n/* ==================== 图片编辑器 ==================== */\n\n.iwb-editor-overlay {\n position: fixed;\n top: 0; left: 0;\n width: 100%; height: 100%;\n background: rgba(0, 0, 0, 0.6);\n display: none;\n align-items: center;\n justify-content: center;\n z-index: 999998;\n backdrop-filter: blur(3px);\n}\n\n.iwb-editor-modal {\n background: #1e1e2e;\n border-radius: 0;\n box-shadow: none;\n display: flex;\n flex-direction: column;\n width: 100vw;\n height: 100vh;\n max-width: none;\n max-height: none;\n overflow: visible;\n}\n\n/* 新增:主区域(画布 + 图层面板)flex 布局 */\n.iwb-editor-main {\n display: flex;\n flex: 1 1 auto;\n min-height: 0;\n overflow: visible;\n}\n\n.iwb-editor-header {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 10px 16px;\n background: #181825;\n border-bottom: 1px solid #313244;\n flex-wrap: nowrap;\n}\n.iwb-editor-header > .iwb-editor-tools {\n position: absolute;\n left: 12px;\n top: 68px;\n width: 44px;\n flex-direction: column;\n padding: 6px;\n background: #181825;\n border: 1px solid #313244;\n border-radius: 8px;\n z-index: 20;\n}\n.iwb-editor-header > .iwb-editor-tools .iwb-editor-action { position: static; }\n.iwb-editor-header > .iwb-editor-tools .iwb-editor-action[data-action="undo"],\n.iwb-editor-header > .iwb-editor-tools .iwb-editor-action[data-action="redo"],\n.iwb-editor-header > .iwb-editor-tools .iwb-editor-action[data-action="reset"],\n.iwb-editor-header > .iwb-editor-tools .iwb-editor-action[data-action="restore"] {\n position: absolute;\n top: -54px;\n left: auto;\n}\n.iwb-editor-header > .iwb-editor-tools .iwb-editor-action[data-action="undo"] { right: 154px; }\n.iwb-editor-header > .iwb-edLine truncated
// image-annotate/plugin/glue.js // image-annotate/plugin/glue.js
function createGlue(ctx, css) { function createGlue(ctx, css) {
+9 -4
View File
@@ -256,6 +256,7 @@ if (!SKIP_PASTE) {
return { c: b.top + b.height / 2, l: b.left, r: b.right } return { c: b.top + b.height / 2, l: b.left, r: b.right }
}) })
const sw = [...pop.querySelectorAll('.iwb-editor-color-swatches [data-panel-color]')] const sw = [...pop.querySelectorAll('.iwb-editor-color-swatches [data-panel-color]')]
const grid = pop.querySelector('.iwb-editor-color-swatches')
return { return {
w: Math.round(r(pop).width), w: Math.round(r(pop).width),
sameRow: items.every((it) => sameRow: items.every((it) =>
@@ -263,11 +264,14 @@ if (!SKIP_PASTE) {
common: sw.length, common: sw.length,
cols: new Set(sw.map((b) => Math.round(r(b).left))).size, cols: new Set(sw.map((b) => Math.round(r(b).left))).size,
swatch: sw.length ? Math.round(r(sw[0]).width) : 0, swatch: sw.length ? Math.round(r(sw[0]).width) : 0,
// v1.20:去色占常用色第一格(20px 同尺寸、第一排最左)
noneFirst: grid.children[0] === pop.querySelector('[data-color-none]'),
cells: grid.children.length,
} }
}) })
check('色板弹层:头部一行(吸管 / 色值 / 图钉同排)+ 常用色 16 个 8 列', check('色板弹层:头部一行(吸管 / 色值 / 图钉同排)+ 去色占常用色第一格 + 15 色 8 列',
Boolean(popShape) && popShape.sameRow && popShape.common === 16 && Boolean(popShape) && popShape.sameRow && popShape.noneFirst && popShape.cells === 16 &&
popShape.cols === 8 && popShape.swatch === 20 && popShape.w === 440, popShape.common === 15 && popShape.cols === 8 && popShape.swatch === 20 && popShape.w === 440,
JSON.stringify(popShape)) JSON.stringify(popShape))
await page.keyboard.press('Escape') await page.keyboard.press('Escape')
await page.waitForTimeout(140) await page.waitForTimeout(140)
@@ -301,7 +305,8 @@ if (!SKIP_PASTE) {
await page.waitForTimeout(250) await page.waitForTimeout(250)
const noneOnStroke = await page.evaluate(() => { const noneOnStroke = await page.evaluate(() => {
const n = document.querySelector('.iwb-editor-color-pop [data-color-none]') const n = document.querySelector('.iwb-editor-color-pop [data-color-none]')
return Boolean(n) && !n.hidden // v1.20:去色不再 hidden,改用 disabled 表达「这个上下文不能去色」
return Boolean(n) && Boolean(n.offsetParent) && !n.disabled
}) })
await page.evaluate(() => document.querySelector('.iwb-editor-color-pop [data-color-none]').click()) await page.evaluate(() => document.querySelector('.iwb-editor-color-pop [data-color-none]').click())
await page.waitForTimeout(300) await page.waitForTimeout(300)
+85 -49
View File
@@ -140,13 +140,15 @@ check('打开编辑器默认只有「原图」1 层,且状态栏不再写「
// v1.3(用户裁定 2026-11-05):调色板从侧栏搬进工具栏弹层,侧栏只剩缩放 // v1.3(用户裁定 2026-11-05):调色板从侧栏搬进工具栏弹层,侧栏只剩缩放
// v1.19(用户 2026-11-10):右栏那份常驻调色面板删掉,颜色只剩弹层一处 // v1.19(用户 2026-11-10):右栏那份常驻调色面板删掉,颜色只剩弹层一处
check('调色板只在工具栏弹层:右栏没有调色模块,SV/色相/16 个常用色都在弹层里', check('调色板只在工具栏弹层:右栏没有调色模块,SV/色相/去色 + 15 个常用色都在弹层里',
await page.evaluate(() => { await page.evaluate(() => {
const q = (s) => Boolean(document.querySelector(s)) const q = (s) => Boolean(document.querySelector(s))
return !q('.iwb-editor-left [data-color-surface]') && !q('.iwb-editor-left .iwb-editor-colors') && return !q('.iwb-editor-left [data-color-surface]') && !q('.iwb-editor-left .iwb-editor-colors') &&
q('.iwb-editor-tools [data-action="toggleColorPop"][data-color-slot="stroke"]') && q('.iwb-editor-tools [data-action="toggleColorPop"][data-color-slot="stroke"]') &&
q('.iwb-editor-color-pop .iwb-color-sv') && q('.iwb-editor-color-pop .iwb-color-hue') && q('.iwb-editor-color-pop .iwb-color-sv') && q('.iwb-editor-color-pop .iwb-color-hue') &&
document.querySelectorAll('.iwb-editor-color-pop .iwb-editor-color-swatches [data-panel-color]').length === 16 && // v1.20:去色进网格占第一格,所以 data-panel-color 只剩 15 个(+ 去色 = 16 格)
document.querySelectorAll('.iwb-editor-color-pop .iwb-editor-color-swatches [data-panel-color]').length === 15 &&
q('.iwb-editor-color-pop .iwb-editor-color-swatches [data-color-none]') &&
q('.iwb-editor-zoom') && q('.iwb-editor-zoom') &&
!q('.iwb-editor-brush-size') && !q('.iwb-editor-brush-num') && !q('.iwb-editor-brush-size') && !q('.iwb-editor-brush-num') &&
document.querySelectorAll('.iwb-editor-brush-preset').length === 0 document.querySelectorAll('.iwb-editor-brush-preset').length === 0
@@ -194,10 +196,12 @@ check('色板弹层默认收起;点工具栏色点弹出、且整块在视口
return inView && !(await pop.isVisible()) ? true : 'box=' + JSON.stringify(box) return inView && !(await pop.isVisible()) ? true : 'box=' + JSON.stringify(box)
})()) })())
// ---------- v1.18 / v1.19 色板弹层布局(用户 2026-11-10) ---------- // ---------- v1.18 / v1.19 / v1.20 色板弹层布局(用户 2026-11-10) ----------
// v1.18:「加钉住」「三项不写标题、用细横线分割」 // v1.18:「加钉住」「三项不写标题、用细横线分割」
// v1.19:「去色放钉住左边、竖线分割」「吸色与色值放在钉住那一排」「宽度再多一点, // v1.19:「去色放钉住左边、竖线分割」「吸色与色值放在钉住那一排」「宽度再多一点,
// 颜色一排 8 个,常用色多加 4 个」「最近色放两排」 // 颜色一排 8 个,常用色多加 4 个」「最近色放两排」
// v1.20:文字工具多出「底色」tab 时头部挤爆,把「去色」整颗抵没了 ——
// 改成去色占常用色第一格(永远在,不可用只置灰),头部元素全部定宽。
await page.locator('.iwb-editor-tool[data-tool="marquee"]').click() // 用选择工具点画布,不落像素 await page.locator('.iwb-editor-tool[data-tool="marquee"]').click() // 用选择工具点画布,不落像素
await page.locator('.iwb-editor-tools [data-action="toggleColorPop"][data-color-slot="stroke"]').click() await page.locator('.iwb-editor-tools [data-action="toggleColorPop"][data-color-slot="stroke"]').click()
await page.waitForTimeout(140) await page.waitForTimeout(140)
@@ -205,48 +209,48 @@ const popLayout = await page.evaluate(() => {
const pop = document.querySelector('.iwb-editor-color-pop') const pop = document.querySelector('.iwb-editor-color-pop')
const r = (el) => el.getBoundingClientRect() const r = (el) => el.getBoundingClientRect()
const none = pop.querySelector('[data-color-none]') const none = pop.querySelector('[data-color-none]')
// 空画布(没选中对象)时「去色」是隐藏的(只有可去色的上下文才给这个按钮), const grid = pop.querySelector('.iwb-editor-color-swatches')
// 这里临时显出来量几何,量完还原 —— 否则 rect 全是 0,位置断言恒假。
const noneWasHidden = none.hidden
if (noneWasHidden) none.hidden = false
const picker = r(pop.querySelector('.iwb-color-pop-picker')) const picker = r(pop.querySelector('.iwb-color-pop-picker'))
const side = r(pop.querySelector('.iwb-color-pop-side')) const side = r(pop.querySelector('.iwb-color-pop-side'))
const head = r(pop.querySelector('.iwb-color-pop-head')) const headEl = pop.querySelector('.iwb-color-pop-head')
const head = r(headEl)
const eye = pop.querySelector('[data-action="palettePick"]') const eye = pop.querySelector('[data-action="palettePick"]')
const hex = pop.querySelector('.iwb-editor-color-hex-input') const hex = pop.querySelector('.iwb-editor-color-hex-input')
const pin = pop.querySelector('[data-action="pinColorPop"]') const pin = pop.querySelector('[data-action="pinColorPop"]')
// 头部一行:吸管 / 色值 / 去色 / 图钉 的竖直中心都必须落在头部这条线上 const sw = [...pop.querySelectorAll('.iwb-editor-color-swatches [data-panel-color]')]
// 去色现在是常用色网格的第一格:位置固定、尺寸和其它色块一致
const noneFirstCell = grid.children[0] === none
const noneSameSize = Math.abs(r(none).width - r(sw[0]).width) < 1 &&
Math.abs(r(none).height - r(sw[0]).height) < 1
const noneRow1 = Math.round(r(none).top) === Math.round(r(sw[0]).top) &&
Math.round(r(none).left) < Math.round(r(sw[0]).left)
// 头部一行:吸管 / 色值 / 图钉 的竖直中心都必须落在头部这条线上
const cy = (el) => r(el).top + r(el).height / 2 const cy = (el) => r(el).top + r(el).height / 2
const headOneRow = [eye, hex, none, pin].every((el) => const headOneRow = [eye, hex, pin].every((el) =>
Math.abs(cy(el) - (head.top + head.height / 2)) < 3 && Math.abs(cy(el) - (head.top + head.height / 2)) < 3 &&
r(el).left >= head.left - 1 && r(el).right <= head.right + 1) r(el).left >= head.left - 1 && r(el).right <= head.right + 1)
const bars = [...pop.querySelectorAll('.iwb-color-pop-bar')].map(r) // 定宽验收:文字工具会多出「底色」tab,头部宽度必须不变形 ——
const noneLeftOfPin = r(none).right <= r(pin).left // 色值框宽度与图钉右边缘在「两 tab / 三 tab」两种上下文下要完全一致,
const barBetweenNonePin = bars.some((b) => // 这条就是用户截图那次 bug 的回归断言(当时去色被 flex 抵掉、色值框从 150 缩到 147)。
b.left >= r(none).right - 1 && b.right <= r(pin).left + 1 && b.height > 8) const hexW2 = Math.round(r(hex).width)
// 文字工具会多出「底色」tab(三格同显):临时显出来验头部不横扫溢出, const pinR2 = Math.round(r(pin).right)
// 否则「吸管 + 色值 + 去色 + 图钉」在窄面板里会把图钉挤出弹层。
const bgTab = pop.querySelector('.iwb-color-pop-tab[data-color-slot="bg"]') const bgTab = pop.querySelector('.iwb-color-pop-tab[data-color-slot="bg"]')
const bgWasHidden = bgTab.hidden const bgWasHidden = bgTab.hidden
const headEl = pop.querySelector('.iwb-color-pop-head')
if (bgWasHidden) bgTab.hidden = false if (bgWasHidden) bgTab.hidden = false
const hexW3 = Math.round(r(hex).width)
const pinR3 = Math.round(r(pin).right)
// 注意用元素本身读 scrollWidth/clientWidth —— DOMRect 上没有这两个属性,写 head.scrollWidth // 注意用元素本身读 scrollWidth/clientWidth —— DOMRect 上没有这两个属性,写 head.scrollWidth
// 会拿到 undefined,比较恒为 false(本次就是这样白跑了两轮) // 会拿到 undefined,比较恒为 false(本次就是这样白跑了两轮)
const headFitsThreeTabs = headEl.scrollWidth <= headEl.clientWidth + 1 && const headFitsThreeTabs = headEl.scrollWidth <= headEl.clientWidth + 1 && r(pin).right <= head.right + 1
[none, pin].every((el) => r(el).right <= head.right + 1)
const headThreeTabsWidth = headEl.scrollWidth
const headDbg = { const headDbg = {
client: pop.querySelector('.iwb-color-pop-head').clientWidth, client: headEl.clientWidth, scroll: headEl.scrollWidth,
scroll: pop.querySelector('.iwb-color-pop-head').scrollWidth,
tabs: [...pop.querySelectorAll('.iwb-color-pop-tab')].map((t) => Math.round(r(t).width)), tabs: [...pop.querySelectorAll('.iwb-color-pop-tab')].map((t) => Math.round(r(t).width)),
hex: Math.round(r(hex).width), hex: hexW3, popW: Math.round(r(pop).width),
popW: Math.round(r(pop).width), headRight: Math.round(head.right), pinR: pinR3,
headRight: Math.round(head.right), noneR: Math.round(r(none).right), pinR: Math.round(r(pin).right),
} }
if (bgWasHidden) bgTab.hidden = true if (bgWasHidden) bgTab.hidden = true
const sw = [...pop.querySelectorAll('.iwb-editor-color-swatches [data-panel-color]')] const row1 = sw.slice(0, 7).map((b) => Math.round(r(b).top))
const row1 = sw.slice(0, 8).map((b) => Math.round(r(b).top)) const row2 = sw.slice(7).map((b) => Math.round(r(b).top))
const row2 = sw.slice(8).map((b) => Math.round(r(b).top))
// 「最近」没有历史色时整组(含外层 group)都是 hidden,量不出网格; // 「最近」没有历史色时整组(含外层 group)都是 hidden,量不出网格;
// 这里临时铺满 16 个量完再还原 —— 只解 wrap 的 hidden 不够,外层还压着一层 // 这里临时铺满 16 个量完再还原 —— 只解 wrap 的 hidden 不够,外层还压着一层
const rec = pop.querySelector('.iwb-editor-recent-colors') const rec = pop.querySelector('.iwb-editor-recent-colors')
@@ -272,28 +276,32 @@ const popLayout = await page.evaluate(() => {
h: Math.round(r(pop).height), h: Math.round(r(pop).height),
headOneRow, headOneRow,
headRows: [head.top, head.bottom, head.left, head.right].map(Math.round), headRows: [head.top, head.bottom, head.left, head.right].map(Math.round),
items: [eye, hex, none, pin].map((el) => [r(el).top, r(el).bottom, r(el).left, r(el).right].map(Math.round)), items: [eye, hex, pin].map((el) => [r(el).top, r(el).bottom, r(el).left, r(el).right].map(Math.round)),
sideInRight: Math.round(side.left) >= Math.round(picker.right), sideInRight: Math.round(side.left) >= Math.round(picker.right),
noneLeftOfPin, noneFirstCell, noneSameSize, noneRow1,
barBetweenNonePin, headFitsThreeTabs, headFixed: hexW2 === hexW3 && pinR2 === pinR3,
headFitsThreeTabs, headThreeTabsWidth, headDbg, hexW: [hexW2, hexW3], pinR: [pinR2, pinR3], headDbg,
common: sw.length, common: sw.length,
twoRows: row1.length === 8 && row2.length === 8 && // 8 列 × 2 行:13 个常用色 + 第一格去色 = 16 格,两排各 8
new Set(row1).size === 1 && new Set(row2).size === 1 && row1[0] < row2[0], twoRows: row1.length === 7 && row2.length === 8 &&
new Set(row1).size === 1 && new Set(row2).size === 1 && row1[0] < row2[0] &&
grid.children.length === 16,
cols: new Set(sw.map((b) => Math.round(r(b).left))).size, cols: new Set(sw.map((b) => Math.round(r(b).left))).size,
recRows, recCols, recRows, recCols,
dividers: [...pop.querySelectorAll('.iwb-color-pop-side > * + *')].map((g) => getComputedStyle(g).borderTopWidth), dividers: [...pop.querySelectorAll('.iwb-color-pop-side > * + *')].map((g) => getComputedStyle(g).borderTopWidth),
labelsVisible: [...pop.querySelectorAll('.iwb-color-group-label')].filter((l) => l.offsetParent !== null).length, labelsVisible: [...pop.querySelectorAll('.iwb-color-group-label')].filter((l) => l.offsetParent !== null).length,
swatch: Math.round(r(sw[0]).width), swatch: Math.round(r(sw[0]).width),
} }
if (noneWasHidden) none.hidden = true
return out return out
}) })
check('色板头部一行装完:吸管 + 色值 + 去色 + 图钉同一排,「去色」在图钉左边且有竖线隔开', check('色板头部一行装完:吸管 + 色值 + 图钉同一排,且加「底色」tab 后色值框与图钉位置纹丝不动',
popLayout.headOneRow && popLayout.noneLeftOfPin && popLayout.barBetweenNonePin && popLayout.headFitsThreeTabs, popLayout.headOneRow && popLayout.headFitsThreeTabs && popLayout.headFixed,
JSON.stringify(popLayout)) JSON.stringify(popLayout))
check('常用色 8 列 × 2 行(16 个),最近色也是 8 列两排,块间 1px 细线且无小标题', check('「去色」是常用色的第一格(20px 同尺寸、第一排最左),不再挂在头部',
popLayout.common === 16 && popLayout.twoRows && popLayout.cols === 8 && popLayout.noneFirstCell && popLayout.noneSameSize && popLayout.noneRow1,
JSON.stringify({ first: popLayout.noneFirstCell, size: popLayout.noneSameSize, row: popLayout.noneRow1, sw: popLayout.swatch }))
check('常用色 8 列 × 2 行(去色 + 15 色 = 16 格),最近色也是 8 列两排,块间 1px 细线且无小标题',
popLayout.common === 15 && popLayout.twoRows && popLayout.cols === 8 &&
popLayout.recCols === 8 && popLayout.recRows === 2 && popLayout.recCols === 8 && popLayout.recRows === 2 &&
popLayout.labelsVisible === 0 && popLayout.dividers.every((d) => d === '1px'), popLayout.labelsVisible === 0 && popLayout.dividers.every((d) => d === '1px'),
JSON.stringify(popLayout)) JSON.stringify(popLayout))
@@ -2135,12 +2143,35 @@ const popTextTarget = await page.evaluate(() => {
fillActive: tab.classList.contains('active'), fillActive: tab.classList.contains('active'),
fillLabel: tab.querySelector('.iwb-color-pop-tab-label').textContent, fillLabel: tab.querySelector('.iwb-color-pop-tab-label').textContent,
bgVisible: !bgTab.hidden, bgVisible: !bgTab.hidden,
noneVisible: !pop.querySelector('[data-color-none]').hidden // v1.20:去色不再 hidden,改成「在不在 + 能不能用」
noneVisible: !!pop.querySelector('[data-color-none]').offsetParent,
noneUsable: !pop.querySelector('[data-color-none]').disabled
} }
}) })
check('点文字的「描边」格:色板目标是描边(tab 写「描边」),底色 tab 同时可选', check('点文字的「描边」格:色板目标是描边(tab 写「描边」),底色 tab 同时可选,去色可用',
popTextTarget.open && popTextTarget.fillActive && popTextTarget.fillLabel === '描边' && popTextTarget.open && popTextTarget.fillActive && popTextTarget.fillLabel === '描边' &&
popTextTarget.bgVisible && popTextTarget.noneVisible, JSON.stringify(popTextTarget)) popTextTarget.bgVisible && popTextTarget.noneVisible && popTextTarget.noneUsable,
JSON.stringify(popTextTarget))
// v1.20(用户 2026-11-10 截图):文字色这一格去不掉色,但按钮必须**留在原位变灰**,
// 不能整颗消失 —— 消失会让色板每切一次工具就重排,位置记不住。
await page.locator('.iwb-editor-color-btn[data-color-slot="stroke"]').click()
await page.waitForTimeout(200)
const noneDisabledOnTextColor = await page.evaluate(() => {
const n = document.querySelector('.iwb-editor-color-pop [data-color-none]')
return {
visible: !!n.offsetParent, disabled: n.disabled, dim: Number(getComputedStyle(n).opacity),
title: n.title, bgTabStillHidden: document.querySelector('.iwb-color-pop-tab[data-color-slot="bg"]').hidden
}
})
check('文字色上下文:去色仍在第一格、只是置灰 disabled(说明原因),不整颗消失',
noneDisabledOnTextColor.visible && noneDisabledOnTextColor.disabled &&
noneDisabledOnTextColor.dim < 0.6 && /去色不可用/.test(noneDisabledOnTextColor.title),
JSON.stringify(noneDisabledOnTextColor))
// 开发用:ANNOT_SHOT3=/tmp/pop-text.png 出「文字工具三 tab + 去色置灰」的效果图(用户截图那个场景)
if (process.env.ANNOT_SHOT3) await page.locator('.iwb-editor-color-pop').screenshot({ path: process.env.ANNOT_SHOT3 })
await page.locator('.iwb-editor-color-btn[data-color-slot="fill"]').click()
await page.waitForTimeout(200)
await page.evaluate(() => { await page.evaluate(() => {
const el = document.querySelector('.iwb-editor-color-pop .iwb-editor-color-hex-input') const el = document.querySelector('.iwb-editor-color-pop .iwb-editor-color-hex-input')
@@ -2582,11 +2613,13 @@ const popTarget = await page.evaluate(() => {
return { return {
open: !pop.hidden, open: !pop.hidden,
fillActive: pop.querySelector('.iwb-color-pop-tab[data-color-slot="fill"]').classList.contains('active'), fillActive: pop.querySelector('.iwb-color-pop-tab[data-color-slot="fill"]').classList.contains('active'),
noneVisible: !pop.querySelector('[data-color-none]').hidden noneVisible: !!pop.querySelector('[data-color-none]').offsetParent,
noneUsable: !pop.querySelector('[data-color-none]').disabled
} }
}) })
check('点填充槽打开色板:目标是填充,并出现「无」按钮', check('点填充槽打开色板:目标是填充,去色在第一格且可用',
popTarget.open && popTarget.fillActive && popTarget.noneVisible, JSON.stringify(popTarget)) popTarget.open && popTarget.fillActive && popTarget.noneVisible && popTarget.noneUsable,
JSON.stringify(popTarget))
// 用一个画布上不会出现的怪色(#a014b2)验收:12 个推荐色在前面用例里都用过, // 用一个画布上不会出现的怪色(#a014b2)验收:12 个推荐色在前面用例里都用过,
// 拿黄色/绿色统计会数到别的图形,永远清不到 0。 // 拿黄色/绿色统计会数到别的图形,永远清不到 0。
@@ -2746,7 +2779,8 @@ const selectedShapeState = () => page.evaluate(() => {
color: s && s.color, fillColor: s && s.fillColor, color: s && s.color, fillColor: s && s.fillColor,
strokeBtnNone: !!btn && btn.classList.contains('is-none'), strokeBtnNone: !!btn && btn.classList.contains('is-none'),
optOff: !!opt && opt.classList.contains('is-off'), optOff: !!opt && opt.classList.contains('is-off'),
noneHidden: !none || none.hidden, // v1.20:去色永远在,只是不可用时 disabled(灰色),所以断言的是「能不能用」不是「在不在」
noneDisabled: !none || none.disabled,
noneActive: !!none && none.classList.contains('active') noneActive: !!none && none.classList.contains('active')
} }
}) })
@@ -2772,7 +2806,9 @@ const magentaBefore = await magentaPerCanvas()
await page.locator('.iwb-editor-color-btn[data-color-slot="stroke"]').click() await page.locator('.iwb-editor-color-btn[data-color-slot="stroke"]').click()
await page.waitForTimeout(220) await page.waitForTimeout(220)
const noneShownOnStroke = await page.evaluate(() => const noneShownOnStroke = await page.evaluate(() =>
!document.querySelector('.iwb-editor-color-pop [data-color-none]').hidden) !document.querySelector('.iwb-editor-color-pop [data-color-none]').disabled)
// 开发用:ANNOT_SHOT4=/tmp/pop-none.png 出「去色可用态」的效果图(形状描边上下文)
if (process.env.ANNOT_SHOT4) await page.locator('.iwb-editor-color-pop').screenshot({ path: process.env.ANNOT_SHOT4 })
await page.evaluate(() => document.querySelector('.iwb-editor-color-pop [data-color-none]').click()) await page.evaluate(() => document.querySelector('.iwb-editor-color-pop [data-color-none]').click())
await page.waitForTimeout(320) await page.waitForTimeout(320)
const noStroke = await selectedShapeState() const noStroke = await selectedShapeState()
@@ -2849,8 +2885,8 @@ await page.waitForTimeout(280)
await page.locator('.iwb-editor-color-btn[data-color-slot="stroke"]').click() await page.locator('.iwb-editor-color-btn[data-color-slot="stroke"]').click()
await page.waitForTimeout(220) await page.waitForTimeout(220)
const openPen = await selectedShapeState() const openPen = await selectedShapeState()
check('未闭合钢笔不给「无描边」(去掉等于把这条线删了)', check('未闭合钢笔不给「无描边」(去掉等于把这条线删了):去色留在原位但置灰',
openPen.type === 'pen' && openPen.closed === false && openPen.noneHidden === true, openPen.type === 'pen' && openPen.closed === false && openPen.noneDisabled === true,
JSON.stringify(openPen)) JSON.stringify(openPen))
// ---- 一边无色也能交换(用户反馈的第二个问题)---- // ---- 一边无色也能交换(用户反馈的第二个问题)----