fix(svg): fix animation on strokePercent will cause partially drawing.#867
Conversation
|
Thanks for the contribution! We rewrite our SVG renderer in the |
|
Sure, I'll check it in |
|
@pissang I have checked out I have compiled a new bundle according to latest |
|
@mrwd2009 Thanks! A new pull request or change target of this pull request to the next branch will be great. |
cb0f877 to
0ee1b32
Compare
|
I have changed target of this pull request, please check. |
| if (elExt.__svgPathVersion !== pathVersion | ||
| || !svgPathBuilder | ||
| || strokePercent < 1 | ||
| || el.style.strokePercent !== elExt.__svgPathStrokePercent |
There was a problem hiding this comment.
Can use variable strokePercent instead of el.style.strokePercent here and in the following code.
There was a problem hiding this comment.
Sure, I have changed the code to use 'strokePercent' directly.
|
The changes have been committed, please check. |

If we apply an animation on 'style.strokePercent' from 0 to 1, the shape won't be drawn completely using SVG renderer.
This problem can be reproduced. You can reference https://codesandbox.io/s/condescending-mclaren-qrhdx?file=/src/App.js . If you click 'Restart Stroke Percent Animation' a few times, you'll see different results.