@hankchen/canvas-editor 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +7 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1422,6 +1422,13 @@ declare class EditorSession {
|
|
|
1422
1422
|
}): Guide | null;
|
|
1423
1423
|
/** 删除参考线(拖回标尺语义):按 id 移除;未知 id 空转返回 false */
|
|
1424
1424
|
removeGuide(id: number): boolean;
|
|
1425
|
+
/**
|
|
1426
|
+
* 移动参考线(抓取拖动再定位的写入口):按 id 原地改位(取向不变),
|
|
1427
|
+
* ui 分支同门——不进历史、不写 graph(ADR 0012),广播 guides 分支通知
|
|
1428
|
+
* (覆盖层失效重绘)。非有限坐标/未知 id 空转返回 false(不产生通知);
|
|
1429
|
+
* 同位空转返回 true(无变化不惊动订阅方——抓取未动的松手路径)。
|
|
1430
|
+
*/
|
|
1431
|
+
updateGuide(id: number, position: number): boolean;
|
|
1425
1432
|
/**
|
|
1426
1433
|
* 清空全部参考线(工具栏「清空参考线」写入口,工单 03 消费):ui 分支整体置空,
|
|
1427
1434
|
* 与 removeGuide 同型广播 guides 分支通知(覆盖层失效重绘)。会话级语义同门——
|
package/dist/index.js
CHANGED
|
@@ -2705,6 +2705,21 @@ var EditorSession = class {
|
|
|
2705
2705
|
this.store.setGuides(next);
|
|
2706
2706
|
return true;
|
|
2707
2707
|
}
|
|
2708
|
+
/**
|
|
2709
|
+
* 移动参考线(抓取拖动再定位的写入口):按 id 原地改位(取向不变),
|
|
2710
|
+
* ui 分支同门——不进历史、不写 graph(ADR 0012),广播 guides 分支通知
|
|
2711
|
+
* (覆盖层失效重绘)。非有限坐标/未知 id 空转返回 false(不产生通知);
|
|
2712
|
+
* 同位空转返回 true(无变化不惊动订阅方——抓取未动的松手路径)。
|
|
2713
|
+
*/
|
|
2714
|
+
updateGuide(id, position) {
|
|
2715
|
+
if (!Number.isFinite(position)) return false;
|
|
2716
|
+
const guides = this.store.ui.guides;
|
|
2717
|
+
const target = guides.find((guide) => guide.id === id);
|
|
2718
|
+
if (target === void 0) return false;
|
|
2719
|
+
if (target.position === position) return true;
|
|
2720
|
+
this.store.setGuides(guides.map((guide) => guide.id === id ? { ...guide, position } : guide));
|
|
2721
|
+
return true;
|
|
2722
|
+
}
|
|
2708
2723
|
/**
|
|
2709
2724
|
* 清空全部参考线(工具栏「清空参考线」写入口,工单 03 消费):ui 分支整体置空,
|
|
2710
2725
|
* 与 removeGuide 同型广播 guides 分支通知(覆盖层失效重绘)。会话级语义同门——
|