Skip to content

Commit 05953d6

Browse files
authored
[fix] wrong len in draw transition with stroke-linecap (#6195)
1 parent a7c7253 commit 05953d6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/runtime/transition/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,10 @@ export function draw(node: SVGElement & { getTotalLength(): number }, {
178178
duration,
179179
easing = cubicInOut
180180
}: DrawParams = {}): TransitionConfig {
181-
const len = node.getTotalLength();
181+
let len = node.getTotalLength();
182+
if (getComputedStyle(node).strokeLinecap !== 'butt') {
183+
len += parseInt(getComputedStyle(node).strokeWidth);
184+
}
182185

183186
if (duration === undefined) {
184187
if (speed === undefined) {

0 commit comments

Comments
 (0)