Jump to content
GreenSock

Nysh

resizing morphSVG on canvas after animation is complete

Recommended Posts

Hey guys, 

 

I've been following some threads / tutorials on rendering SVG on canvas.

My issue is quite simple. I'm trying to make a gooey menu entrance/exit animation using canvas. If I resize the window after the gooey menu is open, the menu suddenly disappears~ I've made a simple codepen to demonstrate.
If the animation is on repeat, and then resize it works fine, so I'm guessing the issue has to do with the my resize and/or animation function? Not sure why it's happening.

Any help is greatly appreciated. Thanks in advance :)

See the Pen bGpMwXP by Nysh (@Nysh) on CodePen

Link to comment
Share on other sites

Hey Nysh. You just need to draw the path to the canvas again after your resize changes (put this at the end of your setCanvasSize function):

draw(MorphSVGPlugin.stringToRawPath(start3.getAttribute("d")), start3);

 

  • Like 3
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.
×