From 5bc29bc889ed140b3c55aced787116bb2eaa0a9d Mon Sep 17 00:00:00 2001 From: umsangdon Date: Fri, 30 Oct 2026 10:36:15 +0900 Subject: [PATCH] =?UTF-8?q?fix(D03):=20=EC=A7=80=EC=A0=90=20=ED=95=80=20?= =?UTF-8?q?=EB=A9=94=EB=89=B4=20=E3=80=8C=EC=A7=80=EC=A0=90=20N=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EA=B8=8B=EA=B8=B0=20=EC=8B=9C=EC=9E=91=E3=80=8D=20?= =?UTF-8?q?=3D=20=EC=A7=80=EC=A0=90=20=EC=9E=90=EB=A6=AC=EC=97=90=EC=84=9C?= =?UTF-8?q?=20=C2=B7=20=EC=9D=B4=EC=96=B4=20=EB=B0=9B=EA=B8=B0=EB=8A=94=20?= =?UTF-8?q?=EC=A7=80=EC=A0=90=20=C2=B7=20=EC=84=A0=EC=9D=B4=20=EB=B0=9B?= =?UTF-8?q?=EC=9D=80=20=EB=B2=94=EC=9C=84=20=EB=B0=96=EC=9D=BC=20=EB=95=8C?= =?UTF-8?q?=EB=A7=8C(=EC=98=9B=20=ED=94=84=EB=A1=9C=EC=A0=9D=ED=8A=B8=20?= =?UTF-8?q?=EC=97=AC=EB=8A=94=20=EC=A6=89=EC=8B=9C=20=EB=B0=9B=EA=B8=B0=20?= =?UTF-8?q?=EC=97=86=EC=9D=8C)=20(PLAN=20591-2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 핀 머리를 우클릭해도 긋기 첫 점 = 지점(전엔 누른 자리 = 지점과 18 px 떨어진 새 본선) - 받은 범위 안 · 가장자리 여유(350 m) 안쪽 선이 있다고 다시 받지 않음 — 받을 때 서버가 여유를 더함 Co-Authored-By: Claude Opus 5.5 --- D03_PlanAnalysis/D03_PlanAnalysis_UI_Page.ts | 18 +++++++----------- D03_PlanAnalysis/D03_PlanAnalysis_UI_Points.ts | 3 ++- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/D03_PlanAnalysis/D03_PlanAnalysis_UI_Page.ts b/D03_PlanAnalysis/D03_PlanAnalysis_UI_Page.ts index f0a8d59f2..a3c8746c4 100644 --- a/D03_PlanAnalysis/D03_PlanAnalysis_UI_Page.ts +++ b/D03_PlanAnalysis/D03_PlanAnalysis_UI_Page.ts @@ -107,7 +107,6 @@ export async function renderD03PlanAnalysis(root: HTMLElement): Promise { let redoStack: Snap[] = []; let surface: PlanSurface | null = null; let have: [number, number, number, number] | null = null; - let margin = 0; // 서버 받기 여유(m) let viewCore: Vertex[] = []; // 지도 보기 가운데 상자 두 귀(넓으면 빈 것) let viewTimer = 0; let lastTried = ""; // 같은 받기를 거듭하지 않음 @@ -306,21 +305,18 @@ export async function renderD03PlanAnalysis(root: HTMLElement): Promise { marks.pins, ]; - /** 점들이 받은 범위 안인가 — `pad` = 둘레 여유(m). */ - const inside = (list: Vertex[], pad: number): boolean => + /** 점들이 받은 범위 안인가. */ + const inside = (list: Vertex[]): boolean => !!have && - list.every( - ([x, y]) => - x - pad >= have![0] && x + pad <= have![2] && y - pad >= have![1] && y + pad <= have![3], - ); - const outside = (): boolean => !!have && !inside([...points, ...allVertices()], 0); + list.every(([x, y]) => x >= have![0] && x <= have![2] && y >= have![1] && y <= have![3]); + const outside = (): boolean => !!have && !inside([...points, ...allVertices()]); - /** 조용히 받기(요구 453) — 지점 · 선(+ 여유) · 지도 보기 가운데가 받은 범위 밖이면 이어 받음 · + /** 조용히 받기(요구 453) — 지점 · 선 · 지도 보기 가운데가 받은 범위 밖이면 이어 받음 · * 단추 · 막는 창 없음 · 실패 = [다시 받기] · 같은 요청은 한 번만. */ async function ensureCovered(): Promise { if (!ready || !editable || busy || failed || !epsg || !root.isConnected) return; const need = [...points, ...allVertices()]; - if (have && inside(need, margin) && inside(viewCore, 0)) return; + if (inside(need) && inside(viewCore)) return; // 받을 때 서버가 여유를 더함 const extra = [...need, ...viewCore]; const key = JSON.stringify([have, extra]); if (key === lastTried) return; @@ -411,7 +407,7 @@ export async function renderD03PlanAnalysis(root: HTMLElement): Promise { try { surface = await fetchPlanSurface(projectId); const extent = await fetchTerrainExtent(projectId, null, []); - [have, margin] = [extent.have_m, extent.margin_m]; + have = extent.have_m; } catch (error) { showToast(`지형면을 읽지 못했습니다 — ${errorText(error)}`, "error"); } diff --git a/D03_PlanAnalysis/D03_PlanAnalysis_UI_Points.ts b/D03_PlanAnalysis/D03_PlanAnalysis_UI_Points.ts index 210242e52..3cb3b662f 100644 --- a/D03_PlanAnalysis/D03_PlanAnalysis_UI_Points.ts +++ b/D03_PlanAnalysis/D03_PlanAnalysis_UI_Points.ts @@ -111,7 +111,8 @@ export function createPlanPoints(params: PlanPointsParams): PlanPoints { if (draw.mode() === "draw" && draw.stroke()) items.push(["긋기 끝", () => draw.setMode("idle")]); else if (pin !== null) { - items.push([`${name(pin)}에서 긋기 시작`, () => draw.startAt(px, py, map)]); + const [sx, sy] = map.toScreen(params.points()[pin]); // 핀 머리를 눌러도 지점 자리에서 + items.push([`${name(pin)}에서 긋기 시작`, () => draw.startAt(sx, sy, map)]); items.push([`${name(pin)} 지우기`, () => remove(pin)]); } else { const label = {