Jump to content
Search Community

DrawSVG progress 50%?

clieee test
Moderator Tag

Recommended Posts

I think this is caused by a small SVG scaled up to 28 times its original size.

 

If I get the length of your path with the getLength() method and then tween to half that, it's perfect. If I tween to 50%, it does look like it goes a bit further. The inline styles seem to be off by 1/2 pixel.
 

<!-- Tweening to half the length  -->
style="stroke-dashoffset: 15.9226; stroke-dasharray: 30.8451px, 40.8451px;"

<!-- Tweening to 50%  -->
style="stroke-dashoffset: 15.4226; stroke-dasharray: 30.8451px, 40.8451px;"

I'm guessing @GreenSock adds a half pixel for safety when using percentages? But since you're scaling this up so much, that half pixel seems pretty big.

 

That's my best guess anyway. @GreenSock can confirm.

 

For now, you can tween to half the length and you should be good to go.

 

Happy tweening.

:)

 

  • Like 4
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...