fix(m01-sl): 선 잇기 · 끊기 · 상자 더하기/지우기 뒤 다이어그램이 옛 그림으로 덮던 흠 — 다음 틱에 다시 그림
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016PSXsvyDxjNmufteN5bqmt
This commit is contained in:
@@ -217,6 +217,11 @@ export function showPaper(
|
||||
sl = structural ? M.item.refreshBases(next) : next;
|
||||
redraw();
|
||||
};
|
||||
/** 다이어그램이 부른 바꿈 — 다이어그램이 제 옛 그림으로 한 번 더 그리므로 다음 틱에 다시 그림 */
|
||||
const editFromDiagram = (next: SheetLogic): void => {
|
||||
edit(next, true);
|
||||
setTimeout(redraw);
|
||||
};
|
||||
|
||||
const name = createInputField({
|
||||
label: tp("Name"),
|
||||
@@ -242,18 +247,18 @@ export function showPaper(
|
||||
connect: (from: Parameters<Mods["model"]["connect"]>[1], to: typeof from): string | null => {
|
||||
const got = M.model.connect(sl, from, to);
|
||||
if (got.why) return got.why;
|
||||
edit(got.sl, true);
|
||||
editFromDiagram(got.sl);
|
||||
return null;
|
||||
},
|
||||
disconnect: (edgeId: string): void => edit(M.model.disconnect(sl, edgeId), true),
|
||||
disconnect: (edgeId: string): void => editFromDiagram(M.model.disconnect(sl, edgeId)),
|
||||
add: (kind: SlKind): void => {
|
||||
const got = M.model.addNode(sl, kind, kindName(kind));
|
||||
selected = got.node.id;
|
||||
edit(got.sl, true);
|
||||
editFromDiagram(got.sl);
|
||||
},
|
||||
remove: (nodeId: string): void => {
|
||||
if (selected === nodeId) selected = null;
|
||||
edit(M.model.removeNode(sl, nodeId), true);
|
||||
editFromDiagram(M.model.removeNode(sl, nodeId));
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user