Skip to content

[feat/MAT-360] 입력 어댑터 패턴 + 지우개 bounds 최적화#302

Open
b0nsu wants to merge 1 commit intorefactor/mat-359-textboxfrom
refactor/mat-360-input-eraser
Open

[feat/MAT-360] 입력 어댑터 패턴 + 지우개 bounds 최적화#302
b0nsu wants to merge 1 commit intorefactor/mat-359-textboxfrom
refactor/mat-360-input-eraser

Conversation

@b0nsu
Copy link
Copy Markdown
Collaborator

@b0nsu b0nsu commented Apr 30, 2026

Summary

터치 입력을 추상화하는 어댑터 패턴을 도입하고, 지우개 히트 테스트에 StrokeBounds를 적용하여 ~20배 성능 개선합니다.
시나리오: 200 strokes에서 지우개 → bounds로 ~190 스킵 → point-level 비교 대폭 감소.

Stacked PR 5/10 — base: refactor/mat-359-textbox

Linear

Changes

  • input/inputTypes.ts — InputPhase, CancelReason, DrawingInputCallbacks
  • input/inputAdapterTypes.ts — InputAdapterConfig, InputAdapterState, InputAdapter
  • input/rnghPanAdapter.ts — RNGH Pan 제스처 어댑터
  • model/drawingTypes.ts — PointerType, InputEvent 타입 추가
  • DrawingCanvas에서 지우개 로직 StrokeBounds 기반으로 최적화

Testing

  • pnpm typecheck 통과
  • pnpm lint 통과

Risk / Impact

  • 영향 범위: 입력 처리 + 지우개 히트 판정 로직
  • 확인이 필요한 부분: 지우개 동작 동일성, 어댑터 패턴 통한 입력 처리
  • 배포 시 유의사항: 없음

- input/inputTypes.ts: InputPhase, CancelReason, DrawingInputCallbacks
- input/inputAdapterTypes.ts: InputAdapterConfig, InputAdapterState, InputAdapter
- input/rnghPanAdapter.ts: useRnghPanAdapter (pencilOnly, eraser/draw 분기)
- model/drawingTypes.ts: PointerType, InputEvent 타입 추가
- DrawingCanvas.tsx:
  - inline pan gesture → useRnghPanAdapter 어댑터로 교체
  - isActiveGesture 제거 (어댑터가 phase 관리)
  - DrawingInputCallbacks로 펜/지우개 콜백 구조화
  - pencilOnly=true (현재 동작 유지: stylus+mouse만 허용)
  - [v2 개선] 지우개 히트 테스트에 StrokeBounds 적용
    strokeBoundsRef로 bounds 관리, eraseAtPoint에서 bounds 체크 우선
    시나리오: 200 strokes → bounds로 ~190 스킵 → ~20배 개선

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

linear Bot commented Apr 30, 2026

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pointer-admin Ready Ready Preview, Comment Apr 30, 2026 11:52am

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