[fix] wrong len in draw transition with stroke-linecap (#6195)

pull/6721/head
Wouter van der Wal 3 years ago committed by GitHub
parent a7c7253691
commit 05953d6c2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -178,7 +178,10 @@ export function draw(node: SVGElement & { getTotalLength(): number }, {
duration,
easing = cubicInOut
}: DrawParams = {}): TransitionConfig {
const len = node.getTotalLength();
let len = node.getTotalLength();
if (getComputedStyle(node).strokeLinecap !== 'butt') {
len += parseInt(getComputedStyle(node).strokeWidth);
}
if (duration === undefined) {
if (speed === undefined) {

Loading…
Cancel
Save