Jump to content

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

Convex Polygon SVG as Draggable bounds?

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


Link to comment
Share on other sites

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

Hej Jack,


yeah, i tried doing something in onDrag, and it seems to somewhat work. Still have to iron out some kinks... or maybe i can convince the designer to change the layout a bit ;)




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.