Jump to content
Search Community

drawSVG bug?

jorma
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Posted

The initial state of the animation the very first time the page is initialised seems incorrect. The line in my CodePen is drawn from the start state of the last tween, not the first. This only happens the first time the drawing is animated. To reproduce this behavior just change the log text and watch the animation.

See the Pen vzmqBw by jormaturkenburg-the-typescripter (@jormaturkenburg-the-typescripter) on CodePen.

Posted

Not a bug. You have two fromTo tweens which have immediateRender set to true by default. So when second fromTo executes, it immediately renders your path to that value. You can either set immediateRender to false or use a 'to tween'.

 

See the Pen aawobp?editors=1010 by Sahil89 (@Sahil89) on CodePen.

 

  • Like 4
  • Thanks 1
Posted

Yup, Sahil is exactly right. In case you need more help understanding immediateRender check out this video

 

 

Also, a little tip for using CodePen. You shouldn't have to change a log() or any code to get your demo to run. You can enable a "run" button via the pen's settings as shown here:

 

u4m99smsSCuC2xOKFWV_dw.png

 

Your pen with "run" button enabled

 

See the Pen dqRoag by GreenSock (@GreenSock) on CodePen.

 

Hope that helps

  • Like 3
  • Thanks 1

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...