Skip to content
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

Merged
merged 2 commits into from
Jan 23, 2024

Conversation

huanhuanwa
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Jan 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
plait ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 23, 2024 9:38am
plait-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 23, 2024 9:38am

@@ -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' | '' {
Copy link
Collaborator

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(
Copy link
Collaborator

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

@pubuzhixing8 pubuzhixing8 merged commit e709924 into develop Jan 23, 2024
3 checks passed
@pubuzhixing8 pubuzhixing8 deleted the w/#WIK-14439 branch January 23, 2024 09:47
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.

None yet

2 participants