feat(774-1): 다시 긋기 = 중간 노드 고름으로 켬 · 다른 중간 노드에 이어야 끝
- 노드 속성 판 · 우클릭 = 중간 노드에 [다시 긋기](선 토막 고름의 [다시 긋기] 뺌) · B05 긋기 중 중간 노드 누름 = 그대로 켬 - 끝 = 같은 선 다른 중간 노드만(rejoinMiss) · 시작 노드 · 끝점 = 못 찍음 + 안내(계속 긋기) · 빈 곳 = 점 찍고 계속 - 고리: 시작 노드 · 이을 중간 노드 · 마우스 올린 중간 노드(paintRejoin · --draw-map-*) · 옛 구간 흐림(dim) 뺌 - 시험: test_771_2 에 끝 판정 · 중간 노드 대조 더함 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
* D03_PlanAnalysis_UI_Menu.ts
|
||||
* D03 지도 우클릭 메뉴(PLAN 591-2 · 598-2 · 요구 463 16 · 22) — 부품 상자 `createMapContextMenu` 하나 · 누른 자리마다 항목.
|
||||
* 긋는 중 = 긋기 끝 · 핀 = 그 지점에서 긋기 · 지우기 · 마커 = 마커 지움 ·
|
||||
* 노드 = 노드 지움 · 지점으로 · 이어 긋기 / 갈래 시작 · 선 끝 = 잇기 · 여기에 잇기(638-3) ·
|
||||
* 선 위 = 갈래 시작 · 여기서 구간 나눔 · 다시 긋기(599) ·
|
||||
* 노드 = 노드 지움 · 지점으로 · 이어 긋기 / 갈래 시작 · 중간 노드 = 다시 긋기(774) · 선 끝 = 잇기 · 여기에 잇기(638-3) ·
|
||||
* 선 위 = 갈래 시작 · 여기서 구간 나눔 ·
|
||||
* 빈 땅 = 여기서 긋기 시작 · 핀 · 노드 밖 = 지점 놓기(노드 둘레면 그 노드에 붙음).
|
||||
* 우클릭 즉시 지움 없음 — 지움은 메뉴 · 고르고 Delete. B05 우클릭(`bindNodeSplice`)과 코드 안 나눔.
|
||||
* 겹 = 맨 끝(맨 위) · 오른쪽 누름만 받음.
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
import { createMapContextMenu, type MapContextMenuItem } from "@ui/ui_template_context_menu";
|
||||
import { samePoint, type PlanNetwork, type Vertex } from "./logic/D03_PlanAnalysis_Plan";
|
||||
import { isMiddleNode } from "./logic/D03_PlanAnalysis_Span";
|
||||
import { lineLimitBlock, type PlanDraw } from "./D03_PlanAnalysis_UI_Draw";
|
||||
import type { PlanEdit } from "./D03_PlanAnalysis_UI_Edit";
|
||||
import { featureOn, type PlanPage } from "./D03_PlanAnalysis_UI_Features";
|
||||
@@ -27,8 +28,8 @@ export interface PlanMenuParams {
|
||||
edit: PlanEdit;
|
||||
draw: PlanDraw;
|
||||
editable: () => boolean;
|
||||
/** [다시 긋기](599-3) — 구역 id · 앞 노드 · 뒤 노드. */
|
||||
respan: (line: string, from: number, to: number) => boolean;
|
||||
/** [다시 긋기](774) — 구역 id · 시작 중간 노드. */
|
||||
respan: (line: string, vertex: number) => boolean;
|
||||
}
|
||||
|
||||
export interface PlanMenu {
|
||||
@@ -82,6 +83,9 @@ export function createPlanMenu(params: PlanMenuParams): PlanMenu {
|
||||
const point = params.network().lines.find((l) => l.id === node.line)!.vertices[node.vertex];
|
||||
const [sx, sy] = map.toScreen(point);
|
||||
start(sx, sy);
|
||||
const count = params.network().lines.find((l) => l.id === node.line)!.vertices.length;
|
||||
if (isMiddleNode(count, node.vertex))
|
||||
items.push(["다시 긋기", () => params.respan(node.line, node.vertex)]);
|
||||
items.push("-", ["노드 지움", () => edit.dropNode(node)]);
|
||||
if (featureOn(page, "join") && edit.isEnd(node))
|
||||
items.push(
|
||||
@@ -92,11 +96,9 @@ export function createPlanMenu(params: PlanMenuParams): PlanMenu {
|
||||
if (marks && !marks.full() && !points().some((p) => samePoint(p, point)))
|
||||
items.push(["지점으로", () => marks.place(sx, sy, map)]);
|
||||
} else if (at?.segment) {
|
||||
const seg = at.segment;
|
||||
start(px, py);
|
||||
if (featureOn(page, "years"))
|
||||
items.push(["여기서 구간 나눔", () => edit.splitAt(px, py, map)]);
|
||||
items.push(["다시 긋기", () => params.respan(seg.line, seg.index, seg.index + 1)]);
|
||||
} else start(px, py);
|
||||
if (marks && pin === null && !at?.node && !at?.mark && !marks.full())
|
||||
items.push("-", ["지점 놓기", () => marks.place(px, py, map)]);
|
||||
|
||||
Reference in New Issue
Block a user