.
This commit is contained in:
parent
c2867c9a93
commit
0360e64219
@ -3750,9 +3750,27 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let { x: sceneX, y: sceneY } = viewportCoordsToSceneCoords(
|
||||||
|
event,
|
||||||
|
this.state,
|
||||||
|
);
|
||||||
|
|
||||||
const selectedElements = this.scene.getSelectedElements(this.state);
|
const selectedElements = this.scene.getSelectedElements(this.state);
|
||||||
|
|
||||||
if (selectedElements.length === 1 && isLinearElement(selectedElements[0])) {
|
if (selectedElements.length === 1 && isLinearElement(selectedElements[0])) {
|
||||||
|
const pointUnderCursorIndex = LinearElementEditor.getPointIndexUnderCursor(
|
||||||
|
selectedElements[0],
|
||||||
|
this.state.zoom,
|
||||||
|
sceneX,
|
||||||
|
sceneY,
|
||||||
|
);
|
||||||
|
if (pointUnderCursorIndex >= 0) {
|
||||||
|
LinearElementEditor.toggleSegmentSplitAtIndex(
|
||||||
|
selectedElements[0],
|
||||||
|
pointUnderCursorIndex,
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
event[KEYS.CTRL_OR_CMD] &&
|
event[KEYS.CTRL_OR_CMD] &&
|
||||||
(!this.state.editingLinearElement ||
|
(!this.state.editingLinearElement ||
|
||||||
@ -3776,11 +3794,6 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
|
|
||||||
resetCursor(this.interactiveCanvas);
|
resetCursor(this.interactiveCanvas);
|
||||||
|
|
||||||
let { x: sceneX, y: sceneY } = viewportCoordsToSceneCoords(
|
|
||||||
event,
|
|
||||||
this.state,
|
|
||||||
);
|
|
||||||
|
|
||||||
const selectedGroupIds = getSelectedGroupIds(this.state);
|
const selectedGroupIds = getSelectedGroupIds(this.state);
|
||||||
|
|
||||||
if (selectedGroupIds.length > 0) {
|
if (selectedGroupIds.length > 0) {
|
||||||
|
@ -1475,7 +1475,6 @@ export class LinearElementEditor {
|
|||||||
|
|
||||||
static toggleSegmentSplitAtIndex(
|
static toggleSegmentSplitAtIndex(
|
||||||
element: NonDeleted<ExcalidrawLinearElement>,
|
element: NonDeleted<ExcalidrawLinearElement>,
|
||||||
appState: AppState,
|
|
||||||
index: number,
|
index: number,
|
||||||
) {
|
) {
|
||||||
let found = false;
|
let found = false;
|
||||||
@ -1491,7 +1490,7 @@ export class LinearElementEditor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mutateElement(element, {
|
mutateElement(element, {
|
||||||
segmentSplitIndices: splitIndices,
|
segmentSplitIndices: splitIndices.sort(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user