fix: remove unnecessary conditions in pointerup for linear elements (#5575)
* fix: remove unnecessary conditions in pointerup for linear elements * reset editingLinearElement when clicked inside bounding box
This commit is contained in:
parent
38e8ae46c9
commit
551c38f60b
@ -4534,9 +4534,8 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
if (this.state.editingLinearElement) {
|
if (this.state.editingLinearElement) {
|
||||||
if (
|
if (
|
||||||
!pointerDownState.boxSelection.hasOccurred &&
|
!pointerDownState.boxSelection.hasOccurred &&
|
||||||
(pointerDownState.hit?.element?.id !==
|
pointerDownState.hit?.element?.id !==
|
||||||
this.state.editingLinearElement.elementId ||
|
this.state.editingLinearElement.elementId
|
||||||
!pointerDownState.hit.hasHitElementInside)
|
|
||||||
) {
|
) {
|
||||||
this.actionManager.executeAction(actionFinalize);
|
this.actionManager.executeAction(actionFinalize);
|
||||||
} else {
|
} else {
|
||||||
@ -4554,10 +4553,8 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
}
|
}
|
||||||
} else if (this.state.selectedLinearElement) {
|
} else if (this.state.selectedLinearElement) {
|
||||||
if (
|
if (
|
||||||
!pointerDownState.boxSelection.hasOccurred &&
|
pointerDownState.hit?.element?.id !==
|
||||||
(pointerDownState.hit?.element?.id !==
|
this.state.selectedLinearElement.elementId
|
||||||
this.state.selectedLinearElement.elementId ||
|
|
||||||
!pointerDownState.hit.hasHitElementInside)
|
|
||||||
) {
|
) {
|
||||||
const selectedELements = getSelectedElements(
|
const selectedELements = getSelectedElements(
|
||||||
this.scene.getNonDeletedElements(),
|
this.scene.getNonDeletedElements(),
|
||||||
@ -4937,7 +4934,6 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!this.state.editingLinearElement &&
|
|
||||||
!pointerDownState.drag.hasOccurred &&
|
!pointerDownState.drag.hasOccurred &&
|
||||||
!this.state.isResizing &&
|
!this.state.isResizing &&
|
||||||
((hitElement &&
|
((hitElement &&
|
||||||
@ -4950,13 +4946,16 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
(!hitElement &&
|
(!hitElement &&
|
||||||
pointerDownState.hit.hasHitCommonBoundingBoxOfSelectedElements))
|
pointerDownState.hit.hasHitCommonBoundingBoxOfSelectedElements))
|
||||||
) {
|
) {
|
||||||
// Deselect selected elements
|
if (this.state.editingLinearElement) {
|
||||||
this.setState({
|
this.setState({ editingLinearElement: null });
|
||||||
selectedElementIds: {},
|
} else {
|
||||||
selectedGroupIds: {},
|
// Deselect selected elements
|
||||||
editingGroupId: null,
|
this.setState({
|
||||||
});
|
selectedElementIds: {},
|
||||||
|
selectedGroupIds: {},
|
||||||
|
editingGroupId: null,
|
||||||
|
});
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user