mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 22:38:56 +08:00
fix: drag mind map root node should layout in real time (#9252)
Fixes [BS-2062](https://linear.app/affine-design/issue/BS-2062/拖拽整个-mind-map-还是希望和之前一样,整个思维导图跟手)
This commit is contained in:
@@ -624,6 +624,15 @@ export class MindmapElementModel extends GfxGroupLikeElementModel<MindmapElement
|
||||
return this._nodeMap.get(id) ?? null;
|
||||
}
|
||||
|
||||
getNodeByPath(path: number[]): MindmapNode | null {
|
||||
let node: MindmapNode | null = this._tree;
|
||||
for (let i = 1; i < path.length; i++) {
|
||||
node = node?.children[path[i]];
|
||||
if (!node) return null;
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
getParentNode(id: string) {
|
||||
const node = this.children.get(id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user