|
|
@ -94,17 +94,27 @@ export function computePhantomPositioning(
|
|
|
|
const segments = action.segments
|
|
|
|
const segments = action.segments
|
|
|
|
const lastSegment = segments[segments.length - 1]
|
|
|
|
const lastSegment = segments[segments.length - 1]
|
|
|
|
const lastSegmentStart = segments[segments.length - 2]?.next
|
|
|
|
const lastSegmentStart = segments[segments.length - 2]?.next
|
|
|
|
const pivotPoint =
|
|
|
|
let pivotPoint = lastSegment.controlPoint
|
|
|
|
lastSegment.controlPoint ??
|
|
|
|
|
|
|
|
(lastSegmentStart
|
|
|
|
if (!pivotPoint) {
|
|
|
|
? typeof lastSegmentStart === "string"
|
|
|
|
if (lastSegmentStart) {
|
|
|
|
|
|
|
|
pivotPoint =
|
|
|
|
|
|
|
|
typeof lastSegmentStart === "string"
|
|
|
|
? document
|
|
|
|
? document
|
|
|
|
.getElementById(lastSegmentStart)!
|
|
|
|
.getElementById(lastSegmentStart)!
|
|
|
|
.getBoundingClientRect()
|
|
|
|
.getBoundingClientRect()
|
|
|
|
: lastSegmentStart
|
|
|
|
: lastSegmentStart
|
|
|
|
: playerBeforePhantom.type === "phantom"
|
|
|
|
} else {
|
|
|
|
? computePhantomPositioning(playerBeforePhantom, content, area)
|
|
|
|
pivotPoint =
|
|
|
|
: playerBeforePhantom.pos)
|
|
|
|
playerBeforePhantom.type === "phantom"
|
|
|
|
|
|
|
|
? computePhantomPositioning(
|
|
|
|
|
|
|
|
playerBeforePhantom,
|
|
|
|
|
|
|
|
content,
|
|
|
|
|
|
|
|
area,
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
: playerBeforePhantom.pos
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const segment = posWithinBase(relativeTo(referentPos, pivotPoint), area)
|
|
|
|
const segment = posWithinBase(relativeTo(referentPos, pivotPoint), area)
|
|
|
|
const segmentLength = norm(segment)
|
|
|
|
const segmentLength = norm(segment)
|
|
|
|