Skip to content

Commit

Permalink
feat: change frame resizing behavior (excalidraw#7307)
Browse files Browse the repository at this point in the history
  • Loading branch information
dwelle committed Nov 17, 2023
1 parent f8d5c2a commit 1e37dbd
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8317,39 +8317,6 @@ class App extends React.Component<AppProps, AppState> {

const elementsToHighlight = new Set<ExcalidrawElement>();
selectedFrames.forEach((frame) => {
const elementsInFrame = getFrameChildren(
this.scene.getNonDeletedElements(),
frame.id,
);

// keep elements' positions relative to their frames on frames resizing
if (transformHandleType) {
if (transformHandleType.includes("w")) {
elementsInFrame.forEach((element) => {
mutateElement(element, {
x:
frame.x +
(frameElementsOffsetsMap.get(frame.id + element.id)?.x || 0),
y:
frame.y +
(frameElementsOffsetsMap.get(frame.id + element.id)?.y || 0),
});
});
}
if (transformHandleType.includes("n")) {
elementsInFrame.forEach((element) => {
mutateElement(element, {
x:
frame.x +
(frameElementsOffsetsMap.get(frame.id + element.id)?.x || 0),
y:
frame.y +
(frameElementsOffsetsMap.get(frame.id + element.id)?.y || 0),
});
});
}
}

getElementsInResizingFrame(
this.scene.getNonDeletedElements(),
frame,
Expand Down

0 comments on commit 1e37dbd

Please sign in to comment.