Compare commits
4 Commits
master
...
frame-resi
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ae88ea555c | ||
![]() |
14eecf651f | ||
![]() |
c951a001f7 | ||
![]() |
25ab75cb9b |
@ -8238,27 +8238,8 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
event[KEYS.CTRL_OR_CMD] ? null : this.state.gridSize,
|
event[KEYS.CTRL_OR_CMD] ? null : this.state.gridSize,
|
||||||
);
|
);
|
||||||
|
|
||||||
const frameElementsOffsetsMap = new Map<
|
const resizingSingleFrameOnly =
|
||||||
string,
|
selectedElements.length === 1 && selectedFrames.length === 1;
|
||||||
{
|
|
||||||
x: number;
|
|
||||||
y: number;
|
|
||||||
}
|
|
||||||
>();
|
|
||||||
|
|
||||||
selectedFrames.forEach((frame) => {
|
|
||||||
const elementsInFrame = getFrameChildren(
|
|
||||||
this.scene.getNonDeletedElements(),
|
|
||||||
frame.id,
|
|
||||||
);
|
|
||||||
|
|
||||||
elementsInFrame.forEach((element) => {
|
|
||||||
frameElementsOffsetsMap.set(frame.id + element.id, {
|
|
||||||
x: element.x - frame.x,
|
|
||||||
y: element.y - frame.y,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// check needed for avoiding flickering when a key gets pressed
|
// check needed for avoiding flickering when a key gets pressed
|
||||||
// during dragging
|
// during dragging
|
||||||
@ -8299,7 +8280,12 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
transformElements(
|
transformElements(
|
||||||
pointerDownState,
|
pointerDownState,
|
||||||
transformHandleType,
|
transformHandleType,
|
||||||
selectedElements,
|
resizingSingleFrameOnly
|
||||||
|
? selectedElements
|
||||||
|
: this.scene.getSelectedElements({
|
||||||
|
selectedElementIds: this.state.selectedElementIds,
|
||||||
|
includeElementsInFrames: true,
|
||||||
|
}),
|
||||||
pointerDownState.resize.arrowDirection,
|
pointerDownState.resize.arrowDirection,
|
||||||
shouldRotateWithDiscreteAngle(event),
|
shouldRotateWithDiscreteAngle(event),
|
||||||
shouldResizeFromCenter(event),
|
shouldResizeFromCenter(event),
|
||||||
@ -8315,18 +8301,19 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
) {
|
) {
|
||||||
this.maybeSuggestBindingForAll(selectedElements);
|
this.maybeSuggestBindingForAll(selectedElements);
|
||||||
|
|
||||||
const elementsToHighlight = new Set<ExcalidrawElement>();
|
// highlight frame children ONLY when resizing a single frame
|
||||||
selectedFrames.forEach((frame) => {
|
if (resizingSingleFrameOnly) {
|
||||||
getElementsInResizingFrame(
|
const selectedFrame = selectedFrames[0];
|
||||||
this.scene.getNonDeletedElements(),
|
if (selectedFrame) {
|
||||||
frame,
|
this.setState({
|
||||||
this.state,
|
elementsToHighlight: getElementsInResizingFrame(
|
||||||
).forEach((element) => elementsToHighlight.add(element));
|
this.scene.getNonDeletedElements(),
|
||||||
});
|
selectedFrame,
|
||||||
|
this.state,
|
||||||
this.setState({
|
),
|
||||||
elementsToHighlight: [...elementsToHighlight],
|
});
|
||||||
});
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user