fix: wrong len in draw transition

pull/6195/head
Wouter van der Wal 5 years ago
parent dafbdc286e
commit 0336a9d456
No known key found for this signature in database
GPG Key ID: 5A0D1F10B1CA9F56

@ -178,7 +178,9 @@ export function draw(node: SVGElement & { getTotalLength(): number }, {
duration,
easing = cubicInOut
}: DrawParams = {}): TransitionConfig {
const len = node.getTotalLength();
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;
if (duration === undefined) {
if (speed === undefined) {

Loading…
Cancel
Save