Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stroke does not complete on sharp corner #223

Open
brycekunkel opened this issue Aug 26, 2019 · 2 comments
Open

Stroke does not complete on sharp corner #223

brycekunkel opened this issue Aug 26, 2019 · 2 comments

Comments

@brycekunkel
Copy link

brycekunkel commented Aug 26, 2019

Vivus version:
Vivus Instant & 0.4.4
Browser:
Chrome
Steps to reproduce it:
Use an SVG with sharp angle (produced from Illustrator) in Vivus

Reproduced Issue:
https://jsfiddle.net/2t1kb9yr/
»Note the top left corner of the left-most part of the "U", and you'll see the break in the corner.

I might be just missing something, but I couldn't find anywhere how to make a more compliant SVG or a setting to pass into Vivus. Thank you for making something so awesome for everyone to use.

Screen Shot 2019-08-26 at 4 50 58 PM

@maxwellito
Copy link
Owner

Hi @brycekunkel,
Sorry about the delay, I was AFK for a little while.
Thanks for reporting the bug, sadly it's a common problem on many browsers where the line don't close even if it should be.

Screenshot 2019-09-08 at 13 03 14
Here is when the path is not complete.

Screenshot 2019-09-08 at 13 03 28
Here is when the path should be more than complete (knowing that the 'length' of this path is 1863px)

However to fix the final view, I would recommend you to use the constructor option selfDestroy to remove all stroke-dash property after the end of the animation. Which will remove all these potential artifacts.

I hope this helps :)

@Shanti9
Copy link

Shanti9 commented Oct 26, 2021

I also noticed this bug! What I have found out is not complete solution but can improve visually and in most of my applications it works good enough.
You only have to apply additional CSS rule on all yours CSS stroke classes:
stroke-linecap: round;
That means that last connecting corner will not be square but round, but it will be connected!
Here is an example of that, where you can see closing cap is round, but not really noticeable unless you really look at it, especially not on smaller sizes:
https://vindu.agency/wp-content/uploads/2020/05/vindu-logo-color-animated.svg
It works for Firefox, Chrome, Edge...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants