From f4311d7f95b34d1547a4d346302617ce77485c21 Mon Sep 17 00:00:00 2001 From: ypshim Date: Wed, 4 Nov 2026 15:48:09 +0900 Subject: [PATCH] =?UTF-8?q?fix(view):=20=E2=91=A2=20=EC=B2=A0=EA=B7=BC?= =?UTF-8?q?=EB=B0=B0=EA=B7=BC=EB=8F=84=20=EC=84=A0=ED=83=9D=ED=95=9C=20?= =?UTF-8?q?=EA=B5=AC=EC=A1=B0=EB=AC=BC=EB=A7=8C=203D=EC=97=90=20=ED=91=9C?= =?UTF-8?q?=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 교각을 선택하면 교대를 숨김(②와 같은 규칙). 교대 선택 시 교각 숨김은 기존대로 - ① ↔ ③ 전환 때도 장면을 다시 만들어 표시 규칙이 바로 반영되게 함 Co-Authored-By: Claude Opus 5.5 --- src/core/abut/visibility.ts | 5 ++--- src/main.ts | 5 +++-- tests/abut-visibility.test.ts | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/core/abut/visibility.ts b/src/core/abut/visibility.ts index 3e8e0f7..0186904 100644 --- a/src/core/abut/visibility.ts +++ b/src/core/abut/visibility.ts @@ -2,7 +2,7 @@ * What the 3D view draws for the selection (2026-11-03, 형상계획 ②). * In ② only the selected object is drawn: a selected abutment hides the piers, and a selected pier hides the abutments. * In ① (형상 생성) the abutments are always drawn, as before; the piers follow 전체 보기 in ①, not this rule. - * In ③ (2026-11-04, 교대 배근) a selected abutment is drawn alone too; with a pier selected, ③ draws as before. + * In ③ (2026-11-04) only the selected object is drawn too, the same as ②: a selected pier hides the abutments. */ /** True when the pier scene (and its rebar) should be built for this stage and selection. */ @@ -12,7 +12,6 @@ export function piersShown(stage: string, abutActive: string | null): boolean { /** True when the abutment with this name should be drawn. */ export function abutShown(stage: string, abutActive: string | null, name: string): boolean { - if (stage === 'rebar') return abutActive === null || name === abutActive; - if (stage !== 'plan') return true; + if (stage !== 'plan' && stage !== 'rebar') return true; return name === abutActive; } diff --git a/src/main.ts b/src/main.ts index fe8d2c2..6e79a7f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -2559,8 +2559,9 @@ function setStage(stage: Stage): void { const previous = state.stage; state.stage = stage; // Switching 전체 보기 on or off in ① needs the scene rebuilt for the new layout. - // Entering or leaving ② changes which objects are drawn (visibility.ts), so the scene is rebuilt then. - if ((allPiers !== null) !== multiSceneOn() || stage === 'plan' || previous === 'plan') setupScene(); + // Entering or leaving ② or ③ changes which objects are drawn (visibility.ts), so the scene is rebuilt then. + const selectionOnly = (s: Stage) => s === 'plan' || s === 'rebar'; + if ((allPiers !== null) !== multiSceneOn() || selectionOnly(stage) !== selectionOnly(previous)) setupScene(); if (state.scene) setRebarView(state.scene, stage === 'rebar'); for (const g of abutGroups) setRebarViewOn(g, stage === 'rebar'); $('view-shape').hidden = stage !== 'shape'; diff --git a/tests/abut-visibility.test.ts b/tests/abut-visibility.test.ts index 1954321..fdb99ef 100644 --- a/tests/abut-visibility.test.ts +++ b/tests/abut-visibility.test.ts @@ -21,12 +21,12 @@ describe('형상계획 ②: 선택한 객체만 3D에 그림', () => { expect(abutShown('shape', null, 'A1')).toBe(true); }); - it('③ draws a selected abutment alone (2026-11-04); with no abutment selected ③ and ④ draw as before', () => { + it('③ draws only the selected object, as ② (2026-11-04); ④ draws as before', () => { expect(piersShown('rebar', 'A1')).toBe(false); expect(abutShown('rebar', 'A1', 'A1')).toBe(true); expect(abutShown('rebar', 'A1', 'A2')).toBe(false); expect(piersShown('rebar', null)).toBe(true); - expect(abutShown('rebar', null, 'A1')).toBe(true); + expect(abutShown('rebar', null, 'A1')).toBe(false); expect(piersShown('quantity', 'A1')).toBe(true); }); });