- 391-1 측점 맴돔 · 고름 = 한 함수(drawStationNormal) · 좌우 20 m 고정 하늘색 · 짧은 12 px 선 · 절성토 색 지움 · 구조물 마름모 그대로 - 391-2 고른 곡선 = 굵은 호 + 교각점→BC · EC 접선 + BC · MC · EC 세 점(새 파일 RouteEdit_Curve_Pick · MC = curveMidVertex) · 곡선 없는 교각점 = 같은 크기 삼각형 - 391-3 잠금 = 황금(#ca8a04 · 어두움 #facc15) · 굵기 4 + 흰 테 - 시험 test_391_routeedit_plan_draw 새로 · test_381_3 맴돔 배선 고쳐 씀 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013QyNXY2TUKXCFMwAca2APG
56 lines
2.4 KiB
Python
56 lines
2.4 KiB
Python
"""381-3 B05 평면 교각점(요구 241-14) — 크기 · 그리는 차례 · 맴돔 강조 · 집기 한 길.
|
|
|
|
겹침 셈(`pickAtScreen`)은 test_b05_routeedit_pick 이 돌려 봄 — 여기는 배선만.
|
|
"""
|
|
|
|
from pathlib import Path
|
|
|
|
B05 = Path(__file__).resolve().parents[2] / "B05_Profile"
|
|
|
|
|
|
def _read(name: str) -> str:
|
|
return (B05 / name).read_text(encoding="utf-8")
|
|
|
|
|
|
def test_노드_크기_문턱():
|
|
assert "const NODE_R = 6;" in _read("B05_Profile_UI_RouteEdit_Render.ts")
|
|
pointer = _read("B05_Profile_UI_RouteEdit_Pointer.ts")
|
|
assert "const NODE_HIT_PX = 12;" in pointer and "const NODE_CORE_PX = 6;" in pointer
|
|
|
|
|
|
def test_노드는_라벨_뒤_맨_위_회전_안():
|
|
render = _read("B05_Profile_UI_RouteEdit_Render.ts")
|
|
scene = render[render.index("export function drawRouteEditScene(") :]
|
|
scene = scene[: scene.index("context.restore(); // 회전 끝")]
|
|
labels = scene.index("drawContourLabels(context, scene, band, style);")
|
|
for later in ("scene.planned.forEach(", "scene.curveInfo.forEach(", "drawPickHover("):
|
|
assert labels < scene.index(later), later
|
|
for earlier in ("drawStationMarks(", "scene.overStations?.(", "drawMeasureMarks("):
|
|
assert scene.index(earlier) < labels, earlier
|
|
|
|
|
|
def test_집기_맴돔_한_함수():
|
|
pointer = _read("B05_Profile_UI_RouteEdit_Pointer.ts")
|
|
assert "pickAtScreen(" in pointer
|
|
down = pointer[pointer.index('addEventListener("pointerdown"') :]
|
|
down = down[: down.index('addEventListener("pointermove"')]
|
|
assert "hover(null);" in down and "const pick = pickAt(px, py);" in down
|
|
assert "nodeAt(px, py)" not in down and "stationAtScreen(" not in down
|
|
move = pointer[pointer.index('addEventListener("pointermove"') :]
|
|
move = move[: move.index("const endDrag")]
|
|
# 끄는 동안은 앞에서 돌아감 — 맴돔은 끌기 갈래 뒤
|
|
assert move.index("if (dragNode >= 0)") < move.index("pickAt(px, py)")
|
|
assert "hover(over);" in move
|
|
assert 'addEventListener("pointerleave"' in pointer
|
|
|
|
|
|
def test_맴돔_그림():
|
|
hover = _read("B05_Profile_UI_RouteEdit_Hover.ts")
|
|
assert "pickHover(context.canvas)" in hover
|
|
assert (
|
|
'"node" in hover' in hover
|
|
and "drawStationNormal(context, scene, line, hover.chainage)" in hover
|
|
)
|
|
# 391-1 맴돔 = 고름 한 함수 · 좌우 20 m 고정
|
|
assert "const STATION_NORMAL_HALF_M = 20;" in hover
|