feat(B07): 자리표 마우스 크기조절·기본 도각 칸 정렬·도면명 미리보기

- 칸이 있는 글자와 그림에 모서리 그립 추가, 모서리를 끌어 칸 크기를 바꾸는 조작 신설 (다른 도면 요소에도 동일 적용)
- 기본 도각(00_template_A1)의 글자 24개에 표제란 칸을 계산해 부여 — 칸 기준 가로·세로 가운데 정렬
- 도각 편집 시 도면명·도면번호도 보던 도면 값으로 미리보기 제공
- 복제 시 미리보기 값 유지 (그립 편집 후 자리표가 토큰으로 되돌아가던 문제)
- CAD index.html 을 캐시하지 않도록 처리 — 빌드 후에도 옛 화면이 남던 문제 해소

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-06 15:52:36 +09:00
co-authored by Claude Opus 5
parent b0c2e09b16
commit d0d3f2a311
9 changed files with 1555 additions and 1305 deletions
@@ -110,12 +110,16 @@ export class TextEntity implements Entity {
}
public clone(): TextEntity {
return new TextEntity(
const copy = new TextEntity(
getActiveLayerId(),
this.label,
this.basePoint.clone(),
cloneDeep(this.options)
);
// 보여 주기용 값도 함께 옮긴다 — 안 옮기면 그립을 옮긴 순간 자리표가 다시
// `{{도면명}}` 으로 보인다(2026-09-06 실측).
copy.previewLabel = this.previewLabel;
return copy;
}
public intersectsWithBox(box: Box): boolean {
@@ -152,6 +156,17 @@ export class TextEntity implements Entity {
this.options.boxHeight = Math.max(height, 1);
}
/** 마주 보는 두 모서리로 칸을 다시 잡는다 — 마우스로 끌어 크기를 바꿀 때 쓴다. */
public setBoxFromCorners(a: Point, b: Point): void {
this.setBoxSize(Math.abs(b.x - a.x), Math.abs(b.y - a.y));
this.basePoint = new Point((a.x + b.x) / 2, (a.y + b.y) / 2);
}
/** 자리표 칸이 있는가 — 칸이 있으면 basePoint 가 칸 한가운데다. */
public hasBox(): boolean {
return Boolean(this.options.boxWidth && this.options.boxHeight);
}
public getTextOptions(): TextOptions {
return this.options;
}