Jump to content
Search Community

SVG Text jitter animation

riTemUp test
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

Hi guys,

I'm developing a "whiteboard animation" style presentation using GSAP. I simulate the camera movement transforming a group that contains all svg content. Everything animates smoothly except the text nodes, that jump a lot, specially in iOS Safari. I tried to isolate the problem in the attached codepen.

Is there a way to avoid this behavior?, I tried changing "will-change" attribute without success...

See the Pen GQwYyx by rimeiQuer (@rimeiQuer) on CodePen

Link to comment
Share on other sites

That actually has nothing to do with GSAP - it's a browser rendering thing. There's some pixel snapping that seems to happen in certain conditions. text-rendering doesn't help either (at least from my tests): https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/text-rendering

 

The only thing that appeared to help is if you apply a tiny amount of rotation so that it forces the browser not to snap those pixels. So even a rotation of 0.1 can help. Does that fix things for you? 

  • Like 4
Link to comment
Share on other sites

I was playing with the rotation solution as well. It seems that using a slight rotation helps in desktop Chrome and Firefox, but in Safari and mobile browsers still looks terrible.

I found that text-rendering solves the problem!! If I use text-rendering: geometricPrecision, the animation runs smoothly in desktop Safari and mobile browsers (at least on iPhone). On mobile the text strokes seem a little more thicker, but the movement is fluid.

I modified the codepen with the results that work in my tests.

 

Thank you @GreenSock and @Jonathan !! You saved my day :)

  • Like 1
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...