-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(draw): add line resize snapping effect #WIK-14439 #720
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
packages/core/src/utils/math.ts
Outdated
@@ -316,3 +316,7 @@ export function isVerticalSegment(points: Point[], tolerance: number = 0) { | |||
export function isPointsOnSameLine(points: Point[], tolerance: number = 0) { | |||
return isHorizontalSegment(points, tolerance) || isVerticalSegment(points, tolerance); | |||
} | |||
|
|||
export function getSegmentDirection(points: Point[], tolerance: number = 0): 'x' | 'y' | '' { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
尽量不要这个,用 isHorizontal 表达
return referencePoint; | ||
} | ||
|
||
export function getNewResizePoints( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以和以前的一致,叫 alignPoints,另外可以把以前的 alignPoints 挪到 line-resize 里面,名称区分下场景
buffer 和 alignPoints 统一 AlignTolerance
No description provided.