-
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(core): support select group #WIK-14428 #764
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
packages/draw/src/utils/group.ts
Outdated
import { PlaitDrawElement } from '../interfaces'; | ||
import { PlaitGroup, PlaitGroupElement } from '../interfaces/group'; | ||
|
||
export const getElementsByGroup = (board: PlaitBoard, group: PlaitGroup, recursion?: boolean) => { |
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.
findElements ?
PlaitBoard.getElementActiveHost(board).append(selectionMovingG); | ||
} | ||
} | ||
const hitElements = getHitElementsBySelection(board, selection); |
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.
感觉应该和 selectionRectangleG 一并考虑,放在一个地方通过判断,现在感觉和 selectionRectangleG 割裂了。
preventTouchMove(board, event, true); | ||
activeElementsRectangle = getRectangleByElements(board, activeElements, true); | ||
} else { | ||
const targetElement = getHitElementByPoint(board, point, el => board.isMovable(el)); | ||
if (targetElement) { | ||
startPoint = point; | ||
activeElements = [targetElement]; | ||
activeElements = getRelatedElements(board, [targetElement]); |
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.
这个语义化不太可以理解
packages/core/src/utils/group.ts
Outdated
return result; | ||
}; | ||
|
||
export const getNewSelectedElements = (board: PlaitBoard, elements: PlaitElement[]) => { |
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.
getNewSelectedElements 代表什么
packages/core/src/utils/group.ts
Outdated
return newSelectedElements; | ||
}; | ||
|
||
export const getCommonElements = (board: PlaitBoard, elements: PlaitElement[]) => { |
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.
这个语义也不清晰
No description provided.