# Triangle restricted drag

**URL:** <https://forum.kirupa.com/t/triangle-restricted-drag/230170>\
**Category:** Uncategorized\
**Created:** [June 23, 2007, 11:46am UTC](https://forum.kirupa.com/t/triangle-restricted-drag/230170 "2007-06-23T11:46:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![7788](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/7788/32/2860_2.png) [@7788](https://forum.kirupa.com/u/7788)\
**Post date:** [June 23, 2007, 11:46am UTC](https://forum.kirupa.com/t/triangle-restricted-drag/230170/1 "2007-06-23T11:46:30Z")

</div>

whats the best way to restrict a draggable object to a non-rectangular shape (like triangle)  
I did it with hittest but i cant get it to go to the nearest point when the cursor is outside the shape…  
Thanks
