Jump to content
Search Community

MorphSVGPlugin convertToPath on rounded <rect>

knalle 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

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

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