Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
@repo/pointer-native-drawing 패키지에서 DrawingCanvas에 있던 타입/유틸을 model/ 디렉토리로 분리하고, 이후 undo/redo 및 지우개 최적화를 위한 기반 타입/유틸(특히 bounds 계산)을 추가하는 PR입니다.
Changes:
model/drawingTypes.ts로 Point/Stroke/TextItem/DrawingCanvasRef 및 readonly/bounds 타입을 추출·정의model/strokeUtils.ts로 deep copy/배열 유틸을 추출하고computeStrokeBounds를 추가- 기존 모듈들(smoothing, DrawingCanvas, index)에서 새 model 모듈을 import/re-export 하도록 정리
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/pointer-native-drawing/src/smoothing.ts | 로컬 Point 타입을 제거하고 model의 Point 타입을 사용하도록 변경 |
| packages/pointer-native-drawing/src/model/strokeUtils.ts | stroke/text deep copy 및 유틸 분리 + stroke AABB 계산 유틸 추가 |
| packages/pointer-native-drawing/src/model/drawingTypes.ts | 드로잉 관련 타입과 readonly/bounds 타입을 model로 추출 |
| packages/pointer-native-drawing/src/index.ts | 새 model 타입/유틸을 패키지 엔트리에서 re-export |
| packages/pointer-native-drawing/src/DrawingCanvas.tsx | 인라인 타입/유틸 제거 후 model에서 import하도록 리팩터링 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+22
to
+27
| export function computeStrokeBounds(points: readonly Point[]): StrokeBounds { | ||
| let minX = Infinity; | ||
| let minY = Infinity; | ||
| let maxX = -Infinity; | ||
| let maxY = -Infinity; | ||
|
|
Comment on lines
+21
to
+23
| /** single-pass O(n)으로 stroke의 AABB를 계산. MAT-360 지우개 히트 테스트 최적화 기반. */ | ||
| export function computeStrokeBounds(points: readonly Point[]): StrokeBounds { | ||
| let minX = Infinity; |
9bcd7ec to
0f5db3b
Compare
…xtbox 임시 비활성화 - model/drawingTypes.ts: Point, Stroke, DrawingCanvasRef 추출 + StrokeBounds (지우개 히트 테스트 최적화 기반) - model/strokeUtils.ts: deepCopyStrokes, safeMax 추출 + computeStrokeBounds (single-pass O(n) AABB) - smoothing.ts: 로컬 Point 제거 → drawingTypes 참조 - DrawingCanvas.tsx: 인라인 타입/유틸 제거 + textbox 시스템 전체 비활성화 (TextItem/get·setTexts/text gesture/keyboard 처리/렌더링 모두 제거 — 재활성화는 별도 PR) - index.ts: 외부 노출 심볼만 re-export (StrokeBounds/computeStrokeBounds 내부 전용) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0f5db3b to
c5700e1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DrawingCanvas에서 타입과 유틸리티를
model/디렉토리로 추출. readonly 타입(ReadonlyPoint, ReadonlyStroke)과 StrokeBounds 타입을 도입하여 후속 이슈(MAT-358 undo/redo, MAT-360 지우개 최적화)의 기반을 마련.Linear
Changes
model/drawingTypes.ts: Point, Stroke, TextItem, DrawingCanvasRef 추출 + ReadonlyPoint, ReadonlyStroke, StrokeBounds 추가model/strokeUtils.ts: deepCopyStrokes, deepCopyTexts, safeMax 추출 + computeStrokeBounds (single-pass O(n)) 추가smoothing.ts: 로컬 Point 제거, drawingTypes에서 importDrawingCanvas.tsx: 인라인 타입/유틸 제거, model에서 importindex.ts: 새 타입/유틸 re-export 추가Testing
pnpm --filter @repo/pointer-native-drawing lint통과Risk / Impact
@repo/pointer-native-drawing패키지 내부 구조 변경만. 외부 API 동일