mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
split curve only for rounded curves
This commit is contained in:
parent
750055ddfa
commit
bc5436592e
2 changed files with 13 additions and 11 deletions
|
@ -3758,18 +3758,20 @@ class App extends React.Component<AppProps, AppState> {
|
||||||
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(
|
if (selectedElements[0].roundness) {
|
||||||
selectedElements[0],
|
const pointUnderCursorIndex = LinearElementEditor.getPointIndexUnderCursor(
|
||||||
this.state.zoom,
|
|
||||||
sceneX,
|
|
||||||
sceneY,
|
|
||||||
);
|
|
||||||
if (pointUnderCursorIndex >= 0) {
|
|
||||||
LinearElementEditor.toggleSegmentSplitAtIndex(
|
|
||||||
selectedElements[0],
|
selectedElements[0],
|
||||||
pointUnderCursorIndex,
|
this.state.zoom,
|
||||||
|
sceneX,
|
||||||
|
sceneY,
|
||||||
);
|
);
|
||||||
return;
|
if (pointUnderCursorIndex >= 0) {
|
||||||
|
LinearElementEditor.toggleSegmentSplitAtIndex(
|
||||||
|
selectedElements[0],
|
||||||
|
pointUnderCursorIndex,
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
event[KEYS.CTRL_OR_CMD] &&
|
event[KEYS.CTRL_OR_CMD] &&
|
||||||
|
|
|
@ -279,7 +279,7 @@ const renderLinearPointHandles = (
|
||||||
const isSelected =
|
const isSelected =
|
||||||
!!appState.editingLinearElement?.selectedPointsIndices?.includes(idx);
|
!!appState.editingLinearElement?.selectedPointsIndices?.includes(idx);
|
||||||
|
|
||||||
const segmented = element.segmentSplitIndices ? element.segmentSplitIndices.includes(idx) : false;
|
const segmented = element.roundness ? (element.segmentSplitIndices ? element.segmentSplitIndices.includes(idx) : false) : false;
|
||||||
|
|
||||||
renderSingleLinearPoint(context, appState, point, radius, isSelected, segmented);
|
renderSingleLinearPoint(context, appState, point, radius, isSelected, segmented);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue