Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
knalle

MorphSVGPlugin convertToPath on rounded <rect>

Recommended Posts

I just noticed that a <rect> with the rx attribute is not converted to a <path> with the same appearance.

 

<rect x="90" y="115" width="228" height="206" rx="23"/>

 

Well, it depends on how you look at it. I guess it is intended behavior from GSAP but not what I expected. Perhaps it should be mentioned in the docs - also if other "basic" SVG shapes attributes are ignored. 

Link to comment
Share on other sites

If you only specify the rx (or ry) attribute, the browser assumes the missing value is equal to the one you specified. I don't think I've ever used the convertToPath() method with a missing attribute like that so I've never seen that happen. @GreenSock should be along later with additional details.

 

For now if you specify both the rx and ry attributes you should see the desired output.

 

Happy tweening.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Ah yes, thatnk you. You are right :) I missed that! It happened with SVGOMG that optimized it "too much". 

 

A notice on this in the docs is better if the alternative is additional checks in convertToPath(), that has a negative impact on speed :)

Link to comment
Share on other sites

Good catch, @PointC. And yes, @knalle, I just added a note to the docs. Cheers!

  • Thanks 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.
×