|
|
@ -116,7 +116,8 @@ export default function BendableArrow({
|
|
|
|
|
|
|
|
|
|
|
|
const styleWidth = style?.width ?? ArrowStyleDefaults.width
|
|
|
|
const styleWidth = style?.width ?? ArrowStyleDefaults.width
|
|
|
|
|
|
|
|
|
|
|
|
const computeInternalSegments = useCallback((segments: Segment[]) => {
|
|
|
|
const computeInternalSegments = useCallback(
|
|
|
|
|
|
|
|
(segments: Segment[]) => {
|
|
|
|
return segments.map((segment, idx) => {
|
|
|
|
return segments.map((segment, idx) => {
|
|
|
|
if (idx == 0) {
|
|
|
|
if (idx == 0) {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
@ -132,7 +133,9 @@ export default function BendableArrow({
|
|
|
|
end: segment.next,
|
|
|
|
end: segment.next,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}, [segments, startPos])
|
|
|
|
},
|
|
|
|
|
|
|
|
[segments, startPos],
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// Cache the segments so that when the user is changing the segments (it moves an ArrowPoint),
|
|
|
|
// Cache the segments so that when the user is changing the segments (it moves an ArrowPoint),
|
|
|
|
// it does not unwind to this arrow's component parent until validated.
|
|
|
|
// it does not unwind to this arrow's component parent until validated.
|
|
|
@ -151,8 +154,6 @@ export default function BendableArrow({
|
|
|
|
const headRef = useRef<HTMLDivElement>(null)
|
|
|
|
const headRef = useRef<HTMLDivElement>(null)
|
|
|
|
const tailRef = useRef<HTMLDivElement>(null)
|
|
|
|
const tailRef = useRef<HTMLDivElement>(null)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Computes and return the segments edition points
|
|
|
|
* Computes and return the segments edition points
|
|
|
|
* @param parentBase
|
|
|
|
* @param parentBase
|
|
|
|