chore(docs): cleanup comments
This commit is contained in:
@@ -96,6 +96,7 @@ watch(isAnimating, (isAnimating) => {
|
||||
const edge = findEdge(props.id)
|
||||
|
||||
if (edge) {
|
||||
// we set the `isAnimating` flag, so we can wait until the next node gets executed
|
||||
edge.data = {
|
||||
...edge.data,
|
||||
isAnimating,
|
||||
@@ -112,6 +113,7 @@ watch(edgePoint, (point) => {
|
||||
|
||||
const nextLength = pathEl.getTotalLength()
|
||||
|
||||
// if length changed, restart animation
|
||||
if (currentLength.value !== nextLength) {
|
||||
runAnimation()
|
||||
return
|
||||
@@ -135,12 +137,15 @@ async function runAnimation() {
|
||||
|
||||
const totalLength = pathEl.getTotalLength()
|
||||
|
||||
// if animation restarted, use last edgePoint value to continue from
|
||||
const from = edgePoint.value || 0
|
||||
|
||||
// update initial label position
|
||||
labelPosition.value = pathEl.getPointAtLength(from)
|
||||
|
||||
isAnimating.value = true
|
||||
|
||||
// update currentLength value, so we can check if the path length changed during animation
|
||||
if (currentLength.value !== totalLength) {
|
||||
currentLength.value = totalLength
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user