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(core): support select group #WIK-14428 #764

Merged
merged 11 commits into from
Mar 5, 2024
Merged

Conversation

huanhuanwa
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Feb 26, 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 Mar 5, 2024 10:04am
plait-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 5, 2024 10:04am

@huanhuanwa huanhuanwa changed the title feat(draw): add group demo #WIK-14428 feat(draw): support select group #WIK-14428 Feb 28, 2024
packages/draw/src/plugins/with-group.ts Outdated Show resolved Hide resolved
import { PlaitDrawElement } from '../interfaces';
import { PlaitGroup, PlaitGroupElement } from '../interfaces/group';

export const getElementsByGroup = (board: PlaitBoard, group: PlaitGroup, recursion?: boolean) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

findElements ?

packages/draw/src/interfaces/group.ts Outdated Show resolved Hide resolved
@huanhuanwa huanhuanwa changed the title feat(draw): support select group #WIK-14428 feat(core): support select group #WIK-14428 Mar 4, 2024
PlaitBoard.getElementActiveHost(board).append(selectionMovingG);
}
}
const hitElements = getHitElementsBySelection(board, selection);
Copy link
Collaborator

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]);
Copy link
Collaborator

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 Show resolved Hide resolved
return result;
};

export const getNewSelectedElements = (board: PlaitBoard, elements: PlaitElement[]) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getNewSelectedElements 代表什么

return newSelectedElements;
};

export const getCommonElements = (board: PlaitBoard, elements: PlaitElement[]) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个语义也不清晰

@pubuzhixing8 pubuzhixing8 merged commit 4df5828 into develop Mar 5, 2024
3 checks passed
@pubuzhixing8 pubuzhixing8 deleted the w/#WIK-14428 branch March 5, 2024 10:16
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