fix(M01): 시트 로직 다이어그램 — 선을 바로 그림(크기 바뀌면 다시) · 끈 뒤 클릭 삼킴이 남지 않게 · 고르면 까닭 줄 지움(PLAN 35-5)
- SheetLogic 전부 검사 초록 - ORCA 견본(상자 7 · 선 8): 단계마다 x 16 · 299 · 582 · 866 · 1149 · 선 끝 알약에서 0.05px 안 · 띠 321 / 화면 1076 · 끌어 잇기 → on.connect · 상자 몸통에 놓으면 같은 이름 자리 · 막히면 한 줄 까닭 · 선 고름 → Delete → on.disconnect · 상자 고르면 이어진 선 넷만 진하게 · 잇기 단추 길 · + 상자 → on.add · Delete → 물음 → on.remove · 밝음 · 어두움 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ly2oHAaTDYRjcniAmHR81z
This commit is contained in:
@@ -129,6 +129,8 @@ interface HostState {
|
||||
pill: { node: string; pill: string; dir: "in" | "out" } | null;
|
||||
note: string;
|
||||
scroll: number;
|
||||
/** 선 다시 그리기 — 띠 크기 바뀜 */
|
||||
watch?: ResizeObserver;
|
||||
}
|
||||
|
||||
const states = new WeakMap<HTMLElement, HostState>();
|
||||
@@ -159,6 +161,7 @@ export function renderDiagram(
|
||||
const select = (id: string | null): void => {
|
||||
st.selected = id;
|
||||
st.pill = null;
|
||||
st.note = "";
|
||||
on.select(id);
|
||||
redraw();
|
||||
};
|
||||
@@ -455,7 +458,11 @@ export function renderDiagram(
|
||||
svg.append(g);
|
||||
}
|
||||
};
|
||||
requestAnimationFrame(drawLines);
|
||||
// 붙어 있으면 바로 · 나중에 붙거나 크기가 바뀌면 다시(띠 밀기 · 창 크기)
|
||||
st.watch?.disconnect();
|
||||
st.watch = typeof ResizeObserver === "undefined" ? undefined : new ResizeObserver(drawLines);
|
||||
st.watch?.observe(inner);
|
||||
if (inner.isConnected) drawLines();
|
||||
|
||||
/* 끌어 잇기 */
|
||||
function startDrag(ev: PointerEvent, from: SlEnd): void {
|
||||
@@ -494,8 +501,10 @@ export function renderDiagram(
|
||||
: boxHit
|
||||
? { node: boxHit.dataset.node ?? "", pill: null, dir: null }
|
||||
: null;
|
||||
// 끈 뒤 따라오는 click 을 한 번 삼킴
|
||||
window.addEventListener("click", (c) => c.stopPropagation(), { capture: true, once: true });
|
||||
// 끈 뒤 바로 따라오는 click 만 삼킴 — 안 오면 곧 풀어 다음 누름은 그대로
|
||||
const swallow = (c: MouseEvent): void => c.stopPropagation();
|
||||
window.addEventListener("click", swallow, { capture: true, once: true });
|
||||
setTimeout(() => window.removeEventListener("click", swallow, { capture: true }), 0);
|
||||
tryConnect(from, target);
|
||||
};
|
||||
window.addEventListener("pointermove", move);
|
||||
|
||||
Reference in New Issue
Block a user