Skip to content

Commit 87a6c2a

Browse files
committed
Improvement - VueUiDonut - Improve serie segregating animation timing
1 parent 81087e1 commit 87a6c2a

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/components/vue-ui-donut.vue

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,6 @@ function segregate(index) {
244244
const target = immutableSet.value.find((_, idx) => idx === index)
245245
const source = mutableSet.value.find((_, idx) => idx === index)
246246
let initVal = source.value;
247-
let incr = 1;
248247
if(segregated.value.includes(index)) {
249248
segregated.value = segregated.value.filter(s => s !== index);
250249
const targetVal = target.value;
@@ -291,25 +290,24 @@ function segregate(index) {
291290
value: 0,
292291
}
293292
} else {
294-
return ds
293+
return ds;
295294
}
296295
});
297296
isAnimating.value = false;
298297
} else {
299298
isAnimating.value = true;
300-
initVal /= (1.1 * incr);
301-
incr += 0.01;
299+
initVal /= 1.1;
302300
mutableSet.value = mutableSet.value.map((ds, i) => {
303301
if(index === i) {
304302
return {
305303
...ds,
306304
value: initVal
307305
}
308306
} else {
309-
return ds
307+
return ds;
310308
}
311309
})
312-
rafDown.value = requestAnimationFrame(animDown)
310+
rafDown.value = requestAnimationFrame(animDown);
313311
}
314312
}
315313
animDown()

0 commit comments

Comments
 (0)