Skip to content

[refactor/MAT-898] DrawingCanvas Stroke bounds 캐시 + computeStrokeBounds 추가#348

Draft
b0nsu wants to merge 1 commit into
developfrom
refactor/mat-898-stroke-bounds
Draft

[refactor/MAT-898] DrawingCanvas Stroke bounds 캐시 + computeStrokeBounds 추가#348
b0nsu wants to merge 1 commit into
developfrom
refactor/mat-898-stroke-bounds

Conversation

@b0nsu
Copy link
Copy Markdown
Collaborator

@b0nsu b0nsu commented May 26, 2026

Summary

Stroke 에 AABB(bounds) 캐시를 도입. MAT-899 의 선결 작업.

Linear

Changes

  • `Stroke` 에 optional `bounds: StrokeBounds` 필드 추가
  • `computeStrokeBounds(points)`: single-pass O(n) AABB 헬퍼
  • `finalizeStroke` 가 새 stroke 에 bounds 채움
  • `loadStrokes` 가 bounds 없는 외부 stroke 를 보강 (기존 직렬화 데이터 호환)
  • `deepCopyStrokes` 가 bounds 참조 복사 (history 손실 방지)
  • `index.ts` 에 `StrokeBounds` / `computeStrokeBounds` export

Testing

  • `pnpm typecheck && pnpm lint && pnpm build` 통과

Risk / Impact

  • props / imperative API 변경 없음
  • 동작 변화 없음 (bounds 는 MAT-899 에서 사용)

…nds 추가

- Stroke에 optional bounds 필드 + StrokeBounds 타입 정의
- single-pass O(n) computeStrokeBounds 헬퍼 도입
- finalizeStroke/loadStrokes 에서 bounds 채움 (외부 직렬화 데이터 보강 포함)
- deepCopyStrokes 에 bounds 참조 복사 (history 복원 손실 방지)
- index.ts 에 StrokeBounds, computeStrokeBounds export

MAT-899 eraser AABB first-pass 의 선결 조건. props/imperative API 변경 없음.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@linear
Copy link
Copy Markdown

linear Bot commented May 26, 2026

MAT-898

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant