chore(docs): cleanup comments

This commit is contained in:
braks
2024-02-08 20:07:50 +01:00
committed by Braks
parent 4fc73421c3
commit 8226796b8b
2 changed files with 18 additions and 5 deletions
+5
View File
@@ -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
}