visual indicator that curve is being split
This commit is contained in:
parent
0360e64219
commit
a2dd3c6ea2
@ -157,10 +157,13 @@ const fillCircle = (
|
|||||||
cy: number,
|
cy: number,
|
||||||
radius: number,
|
radius: number,
|
||||||
stroke = true,
|
stroke = true,
|
||||||
|
noFill = false,
|
||||||
) => {
|
) => {
|
||||||
context.beginPath();
|
context.beginPath();
|
||||||
context.arc(cx, cy, radius, 0, Math.PI * 2);
|
context.arc(cx, cy, radius, 0, Math.PI * 2);
|
||||||
|
if (!noFill) {
|
||||||
context.fill();
|
context.fill();
|
||||||
|
}
|
||||||
if (stroke) {
|
if (stroke) {
|
||||||
context.stroke();
|
context.stroke();
|
||||||
}
|
}
|
||||||
@ -224,6 +227,7 @@ const renderSingleLinearPoint = (
|
|||||||
point: Point,
|
point: Point,
|
||||||
radius: number,
|
radius: number,
|
||||||
isSelected: boolean,
|
isSelected: boolean,
|
||||||
|
isSegmentSplitting: boolean,
|
||||||
isPhantomPoint = false,
|
isPhantomPoint = false,
|
||||||
) => {
|
) => {
|
||||||
context.strokeStyle = "#5e5ad8";
|
context.strokeStyle = "#5e5ad8";
|
||||||
@ -242,6 +246,16 @@ const renderSingleLinearPoint = (
|
|||||||
radius / appState.zoom.value,
|
radius / appState.zoom.value,
|
||||||
!isPhantomPoint,
|
!isPhantomPoint,
|
||||||
);
|
);
|
||||||
|
if (isSegmentSplitting) {
|
||||||
|
fillCircle(
|
||||||
|
context,
|
||||||
|
point[0],
|
||||||
|
point[1],
|
||||||
|
(radius + 4) / appState.zoom.value,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const renderLinearPointHandles = (
|
const renderLinearPointHandles = (
|
||||||
@ -265,7 +279,9 @@ const renderLinearPointHandles = (
|
|||||||
const isSelected =
|
const isSelected =
|
||||||
!!appState.editingLinearElement?.selectedPointsIndices?.includes(idx);
|
!!appState.editingLinearElement?.selectedPointsIndices?.includes(idx);
|
||||||
|
|
||||||
renderSingleLinearPoint(context, appState, point, radius, isSelected);
|
const segmented = element.segmentSplitIndices ? element.segmentSplitIndices.includes(idx) : false;
|
||||||
|
|
||||||
|
renderSingleLinearPoint(context, appState, point, radius, isSelected, segmented);
|
||||||
});
|
});
|
||||||
|
|
||||||
//Rendering segment mid points
|
//Rendering segment mid points
|
||||||
@ -293,6 +309,7 @@ const renderLinearPointHandles = (
|
|||||||
segmentMidPoint,
|
segmentMidPoint,
|
||||||
radius,
|
radius,
|
||||||
false,
|
false,
|
||||||
|
false,
|
||||||
);
|
);
|
||||||
highlightPoint(segmentMidPoint, context, appState);
|
highlightPoint(segmentMidPoint, context, appState);
|
||||||
} else {
|
} else {
|
||||||
@ -303,6 +320,7 @@ const renderLinearPointHandles = (
|
|||||||
segmentMidPoint,
|
segmentMidPoint,
|
||||||
radius,
|
radius,
|
||||||
false,
|
false,
|
||||||
|
false,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else if (appState.editingLinearElement || points.length === 2) {
|
} else if (appState.editingLinearElement || points.length === 2) {
|
||||||
@ -312,6 +330,7 @@ const renderLinearPointHandles = (
|
|||||||
segmentMidPoint,
|
segmentMidPoint,
|
||||||
POINT_HANDLE_SIZE / 2,
|
POINT_HANDLE_SIZE / 2,
|
||||||
false,
|
false,
|
||||||
|
false,
|
||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user