From be05f314796b823a8d138cd0940c512733f039c8 Mon Sep 17 00:00:00 2001 From: qiqi Date: Wed, 4 Nov 2026 17:39:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(image-annotate):=20dom=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=A4=9A=E4=BD=99=E9=97=AD=E5=90=88=E6=A0=87=E7=AD=BE=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=8A=B6=E6=80=81=E6=A0=8F=E8=A2=AB=E6=8C=A4=E5=87=BA?= =?UTF-8?q?=20modal=E3=80=81=E5=8F=B3=E4=BE=A7=E6=BC=8F=E5=87=BA=E5=AE=BF?= =?UTF-8?q?=E4=B8=BB=E7=95=8C=E9=9D=A2=EF=BC=881.1.0=20=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- image-annotate/plugin/editor/dom.js | 1 - image-annotate/src/index.js | 1 - image-annotate/tools/harness.mjs | 12 ++++++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/image-annotate/plugin/editor/dom.js b/image-annotate/plugin/editor/dom.js index 57a72f6..5de35a5 100644 --- a/image-annotate/plugin/editor/dom.js +++ b/image-annotate/plugin/editor/dom.js @@ -212,7 +212,6 @@ import { bindEvents } from './events.js' - diff --git a/image-annotate/src/index.js b/image-annotate/src/index.js index 297d4f4..d01a719 100644 --- a/image-annotate/src/index.js +++ b/image-annotate/src/index.js @@ -1761,7 +1761,6 @@ var __IWB_ANNOTATE_MANIFEST__ = { - diff --git a/image-annotate/tools/harness.mjs b/image-annotate/tools/harness.mjs index a526759..a754d2a 100644 --- a/image-annotate/tools/harness.mjs +++ b/image-annotate/tools/harness.mjs @@ -115,6 +115,18 @@ check('编辑器打开 + 便利 UI 五区齐全', await page.evaluate(() => { check('新增选区工具按钮', (await page.locator('.iwb-editor-tool[data-tool="marquee"]').count()) === 1 && (await page.locator('.iwb-editor-tool[data-tool="lasso"]').count()) === 1) +check('modal 铺满视口、状态栏贴在 modal 底部(防多余 把状态栏挤成 overlay 的 flex 兄弟)', await page.evaluate(() => { + const ov = document.querySelector('#iwb-editor-overlay') + const modal = ov.querySelector('.iwb-editor-modal') + const sb = ov.querySelector('.iwb-editor-statusbar') + if (!ov || !modal || !sb) return false + const vw = window.innerWidth + const m = modal.getBoundingClientRect(), s = sb.getBoundingClientRect(), o = ov.getBoundingClientRect() + const inside = (a, b) => a.left >= b.left - 1 && a.right <= b.right + 1 && a.top >= b.top - 1 && a.bottom <= b.bottom + 1 + return Math.round(m.width) === vw && Math.round(o.width) === vw && + Math.abs(s.bottom - m.bottom) < 3 && inside(m, o) && inside(s, m) +})) + const imgBox = await page.locator('.iwb-editor-layer-canvas').first().boundingBox() const drag = async (x1, y1, x2, y2) => { await page.mouse.move(x1, y1)