mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
compute midpoints properly when dealing with split line indices
This commit is contained in:
parent
7f5b7bab69
commit
26f9b54199
1 changed files with 4 additions and 1 deletions
|
@ -547,7 +547,10 @@ export class LinearElementEditor {
|
||||||
endPointIndex: number,
|
endPointIndex: number,
|
||||||
) {
|
) {
|
||||||
let segmentMidPoint = centerPoint(startPoint, endPoint);
|
let segmentMidPoint = centerPoint(startPoint, endPoint);
|
||||||
if (element.points.length > 2 && element.roundness) {
|
const splits = element.segmentSplitIndices || [];
|
||||||
|
const treatAsCurve =
|
||||||
|
splits.includes(endPointIndex) || splits.includes(endPointIndex - 1);
|
||||||
|
if (element.points.length > 2 && (element.roundness || treatAsCurve)) {
|
||||||
const controlPoints = getControlPointsForBezierCurve(
|
const controlPoints = getControlPointsForBezierCurve(
|
||||||
element,
|
element,
|
||||||
element.points[endPointIndex],
|
element.points[endPointIndex],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue