From 3ef36971cf692760fe0801fa422cdda8fdd04a11 Mon Sep 17 00:00:00 2001 From: Conduitry Date: Fri, 10 Sep 2021 11:47:45 -0400 Subject: [PATCH] tidy --- src/runtime/transition/index.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/runtime/transition/index.ts b/src/runtime/transition/index.ts index 97e935b50c..fc42ee2dcf 100644 --- a/src/runtime/transition/index.ts +++ b/src/runtime/transition/index.ts @@ -178,9 +178,10 @@ export function draw(node: SVGElement & { getTotalLength(): number }, { duration, easing = cubicInOut }: DrawParams = {}): TransitionConfig { - const has_end_caps = getComputedStyle(node).strokeLinecap !== 'butt'; - const cap_size = has_end_caps ? parseInt(getComputedStyle(node).strokeWidth) : 0; - const len = node.getTotalLength() + cap_size; + let len = node.getTotalLength(); + if (getComputedStyle(node).strokeLinecap !== 'butt') { + len += parseInt(getComputedStyle(node).strokeWidth); + } if (duration === undefined) { if (speed === undefined) {