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


#1

Hi,

I read this post:  http://www.juce.com/forum/topic/horizonatl/vertical-dragger 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.

Cheers

 

 


#2

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


#3

thanks I'll give it a try


#4

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?

 


#5

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.