Nysh Posted September 11, 2020 Share Posted September 11, 2020 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 More sharing options...
ZachSaucier Posted September 11, 2020 Share Posted September 11, 2020 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); 3 Link to comment Share on other sites More sharing options...
Nysh Posted September 12, 2020 Author Share Posted September 12, 2020 Zach! Thanks so much mate. That worked See the Pen qBZYPMM?editors=1010 by Nysh (@Nysh) on CodePen Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now