mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-18 06:50:31 +02:00
compute midpoints properly when dealing with split line indices
This commit is contained in:
@@ -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],
|
||||||
|
Reference in New Issue
Block a user