Jump to content
Search Community

Convex Polygon SVG as Draggable bounds?

frannyglass79 test
Moderator Tag

Go to solution Solved by GreenSock,

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 there,

 

i need to constrain an element to a convex polygonal object. I made a test with an svg set for the Draggable's bounds, however i had the impression Draggable just used the svg's BoundingBox. Is that so?

Any ideas or hints as to how to accomplish this task?

 

Thanks a lot

Nadja

Link to comment
Share on other sites

  • Solution

Yeah, sorry but bounds can only be rectangles. It's immensely more complex to accommodate a polygonal shape. It'd probably cost at least 10x more processing every time you move your mouse, plus it'd be expensive kb-wise. I wish I had an easy solution for you. 

 

Maybe you could write your own logic and drop it into an onDrag, but that'd be non-trivial.

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