fix(B06 횡단): 암 경계선 판정 선을 설계선 판정 아래로 — 사면 발치 겹친 자리는 사면이 먼저 골라짐 (370-3)

- 화면 검증에서 1+0 우 절토 사면 누름이 암 판정 선에 먹힘 · 그리는 차례만 아래로(키 차례 그대로)
- test_370_3 판정 선 「설계선 판정 아래」 확인 · helper insertBefore 참조 자리 따름

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014utrjfoW831Vc5wJUd13kL
This commit is contained in:
2026-10-17 13:16:57 +09:00
co-authored by Claude Opus 5.5
parent fe025b6db2
commit 75f4cc982f
3 changed files with 10 additions and 5 deletions
@@ -522,6 +522,8 @@ export function attachDesignLinePick(input: {
});
layer.insertBefore(hit, firstStructureHit ?? null);
});
// 암 판정 선은 보라 선 판정 아래 — 사면 발치처럼 겹친 자리는 설계선이 먼저 골라짐
if (rockHit && hits[0] !== rockHit) layer.insertBefore(rockHit, hits[0]);
const cell = buildLineCell();
let side: CrossSide | null = null;
+7 -4
View File
@@ -47,8 +47,11 @@ class Node {
append(...kids) {
this.children.push(...kids);
}
insertBefore(kid) {
this.children.push(kid);
insertBefore(kid, ref) {
this.children = this.children.filter((k) => k !== kid);
const at = ref ? this.children.indexOf(ref) : -1;
if (at < 0) this.children.push(kid);
else this.children.splice(at, 0, kid);
}
setAttribute(n, v) {
this.attrs[n] = String(v);
@@ -238,13 +241,13 @@ const out = {};
// ② 판정 선 — 점선 위 path 하나(끊긴 두 토막 · M 둘) · 보라 선 판정 클래스 · 키 rock
{
const c = card();
const index = c.hits.indexOf(c.rockHit);
c.rockHit.click();
const index = c.picks[0];
out.hit = {
found: !!c.rockHit,
tag: c.rockHit?.tagName,
moves: (c.rockHit?.getAttribute("d").match(/M/g) ?? []).length,
last: index === c.hits.length - 1,
below: c.hits.indexOf(c.rockHit) === 0, // 그리는 차례 = 보라 선 판정 아래(겹친 자리는 설계선)
picked: c.picks,
};
// ③ 고름 — 제목 · ▲▼↺ · ◀▶ 막음 · ▲▼ = 암만(종단으로 안 샘)
+1 -1
View File
@@ -42,7 +42,7 @@ def test_안_고르면_공용_칸은_암_버튼과_값(out: dict) -> None:
def test_암_경계선_판정_선(out: dict) -> None:
hit = out["hit"]
assert hit["found"] and hit["tag"] == "path" and hit["moves"] == 2 # 끊긴 두 토막 한 판정
assert hit["last"] and hit["picked"] == [3] # 조각 셋 뒤 · 누르면 고름
assert hit["below"] and hit["picked"] == [3] # 설계선 판정 아래 · 키 차례 = 조각 셋 뒤
def test_암_고름은_위아래만_암_키는_암만(out: dict) -> None: