Restrict the Drag Movement to Up Down on the Juce Demo Drag and Drop


I read this post: but I simply would like to restrict the drag and drop movement to the y direction.  Do I need a ComponentBoundsConstrainer and override of checkBounds or is there an easier way ?  I don't want to resize the dragged item.




Yes, just override the checkBounds. You don't have to modify the size, you can just modify its postion.

thanks I'll give it a try

Jules, I have to admit I'm a little confused.  My setup is almost identical to the Drag and Drop in Juce Demo.  Ok, so I need to use checkBounds but it's the transparent image that I want to restrcit the x direction movement of.  

How would I go about applying checkBounds to that image?


The post you referred to was talking about ComponentDragger, which is completely different to normal drag-and-drop! There's no way to constrain the normal drag+drop system, you'd need to write your own drag methods to do that.