From a8512ba77769679889188fd04489200ca0b06d4d Mon Sep 17 00:00:00 2001 From: qiqi Date: Tue, 10 Nov 2026 08:48:25 +0800 Subject: [PATCH] =?UTF-8?q?feat(image-annotate):=20v1.20.1=20=E5=90=B8?= =?UTF-8?q?=E7=AE=A1+=E8=89=B2=E5=80=BC=E6=95=B4=E7=BB=84=E5=8F=B3?= =?UTF-8?q?=E5=AF=B9=E9=BD=90=EF=BC=88=E4=B8=8D=E5=86=8D=E9=9A=8F=20tab=20?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E6=B5=AE=E5=8A=A8=EF=BC=89=EF=BC=8C=E8=89=B2?= =?UTF-8?q?=E5=80=BC=E6=A1=86=20124=E2=86=9296?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- image-annotate/README.md | 20 +++++++++++++++++++ image-annotate/package.json | 2 +- image-annotate/plugin/editor.css | 14 ++++++------- image-annotate/plugin/editor/dom.js | 11 +++++++--- image-annotate/src/index.js | 15 +++++++++----- image-annotate/tools/harness.mjs | 31 ++++++++++++++++------------- 6 files changed, 63 insertions(+), 30 deletions(-) diff --git a/image-annotate/README.md b/image-annotate/README.md index 4ebc0ee..a0faff5 100644 --- a/image-annotate/README.md +++ b/image-annotate/README.md @@ -234,6 +234,26 @@ P 下双击 = 结束当前路径(`commitPenPath`),不再进节点编辑。 - 文字 / 形状 / 钢笔会被直接栅格化进结果层(PS 合并矢量层也是这个结果)。 - 结果层落回「原最低参与层」的位置,`assignLayerZ` 重新连续编号,不产生重复 z。 +## v1.20.1:吸管 + 色值整组右对齐 / 色值框 124 → 96 + +用户截图:「吸色与色值部分有问题,他现在是左对齐,就会因为前面的颜色属性浮动,我需要他不浮动, +你可以改为右对齐看看,设置框可以小一些,现在长了」。 + +``` +[文字●][描边●][底色●] ⌖ [ #2F6FED ] │ 📌 + ↑ 这一段整组钉在右侧 +``` + +- v1.20 只把**图钉**推到最右,吸管与色值还紧跟 tab —— 文字工具多出「底色」tab 时这一组就整体右移一次, + 切回形状又左移一次,视线每次都要重新找。现在 `.iwb-color-pop-tools` 把 + **吸管 + 色值 + 竖线 + 图钉**整组包住并 `margin-left: auto`,左侧剩余空隙全由 tab 组吸收。 +- 右组前那条竖线删掉:右对齐后它只会孤零零悬在空白里,空隙本身已经把「选槽 / 取色」分开了。 + 留下的那条竖线是分隔「图钉」这个常驻开关,位置固定。 +- 色值框 `124 → 96px`(用户「设置框可以小一些,现在长了」):#RRGGBB 在 13px 等宽下约 55px, + 加 padding 仍有 30px 余量。它现在是右组里的一颗「读数」,不该比吸管/图钉更重。 +- 回归断言从「宽度不变」升级为「**逐像素坐标不变**」:`sig = [吸管左, 色值左, 图钉左, 图钉右]`, + 两 tab 与三 tab 两种上下文下 `597,629,738,762` 必须完全相同,且图钉右边缘贴住头部右边界(`rightPinned`)。 + ## v1.20.0:去色下移成常用色第一格 / 头部全部定宽,不再被自动布局抵掉 用户截图反馈:「如果是文本元素的时候,就会把那个去色按钮给丢掉…可以让这些颜色选项一直保持在上面, diff --git a/image-annotate/package.json b/image-annotate/package.json index 9e865ee..df71ddd 100644 --- a/image-annotate/package.json +++ b/image-annotate/package.json @@ -1,7 +1,7 @@ { "name": "@iwb-plugin/image-annotate", "private": true, - "version": "1.20.0", + "version": "1.20.1", "description": "IWB 插件:图片标注 / 修图(编辑器移植自 iwb-plaus 扩展,纯 Canvas 2D)", "ibwPlugin": { "id": "image-annotate", diff --git a/image-annotate/plugin/editor.css b/image-annotate/plugin/editor.css index 9ced57a..a69b432 100755 --- a/image-annotate/plugin/editor.css +++ b/image-annotate/plugin/editor.css @@ -1803,8 +1803,9 @@ .iwb-color-pop-head { display: flex; align-items: center; gap: 6px; } /* 竖线:分隔「调哪个槽 / 取色工具 / 去色·钉住」三组,比空白更清楚,又不加边框重量 */ .iwb-color-pop-bar { width: 1px; height: 16px; background: #313244; flex: 0 0 auto; } -/* 「去色 | 图钉」整组贴最右(margin-left:auto)。这样色值框不用拉成一条长条去填空, - 头部是「左边调色槽与工具 / 右边一个开关」两段式,扫视时不会把 HEX 当成主角。 */ +/* 「吸管 + 色值 + 图钉」整组贴最右(margin-left:auto,v1.20.1)。 + v1.20 只推图钉、吸管与色值紧跟 tab —— tab 从 2 个变 3 个(文字工具加「底色」), + 这组就整块左右浮一次。现在 tab 组独占左侧、空隙全给它吸收,右组从第一条竖线起整体钉住。 */ .iwb-color-pop-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: 0 0 auto; } .iwb-color-pop-tab { @@ -1878,12 +1879,11 @@ /* display:flex 会盖掉 [hidden] 的默认 display:none,必须显式写一条 */ .iwb-color-group[hidden] { display: none; } -/* 色值输入定宽 124(v1.20 由 150 收窄、且不再可缩):#RRGGBB 七个字符 55px 出够, - v1.19 用的是 flex:0 1 150px,文字工具多出「底色」tab 时它会自己缩到 147 —— - 头部宽度就跟着上下文抖,最后把「去色」整颗挤掉(用户截图里那次)。 - 现在头部每个元素都定宽:只有 gap 吸收亚像素误差,切工具不再重排。 */ +/* 色值输入定宽 96(v1.20.1 由 124 再收窄,用户「设置框可以小一些,现在长了」)。 + #RRGGBB 七个字符在 13px 等宽下约 55px,加左右 padding 10px 仍有 30px 余量; + 它现在是右组里的一颗「读数」,不该比吸管/图钉重。仍然定宽不可缩。 */ .iwb-editor-color-pop .iwb-editor-color-hex-input { - flex: 0 0 124px; width: 124px; height: 26px; padding: 0 5px; text-align: center; + flex: 0 0 96px; width: 96px; height: 26px; padding: 0 4px; text-align: center; font: 600 12px monospace; border-radius: 6px; box-sizing: border-box; } .iwb-editor-color-pop .iwb-editor-color-swatches { diff --git a/image-annotate/plugin/editor/dom.js b/image-annotate/plugin/editor/dom.js index 5b7339f..76b638e 100644 --- a/image-annotate/plugin/editor/dom.js +++ b/image-annotate/plugin/editor/dom.js @@ -46,10 +46,15 @@ import { bindEvents } from './events.js' - - - + + + + +