Skip to content

Commit

Permalink
fix: optimzie code
Browse files Browse the repository at this point in the history
  • Loading branch information
huanhuanwa committed Apr 19, 2024
1 parent 585de80 commit 275bf19
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core/src/utils/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ export const createGroupRectangleG = (board: PlaitBoard, elements: PlaitElement[
elements.forEach(item => {
const isRender = (!selectedElementIds.includes(item.id) && !isMoving) || isMoving;
if (item.groupId && isRender) {
groupRectangleG = createG();
if (!groupRectangleG) {
groupRectangleG = createG();
}
const elements = getElementsInGroupByElement(board, item);
const rectangle = getRectangleByElements(board, elements, false);
const rectangleG = drawRectangle(board, rectangle, {
Expand Down

0 comments on commit 275bf19

Please sign in to comment.