How can I restrict DragPoint to only allow dragging in the Y direction? #637
-
|
I don't want the user to be able to drag in the X direction. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
I don't think there is a built-in way of constraining Constrain after callYou could always return the X value to the previous value after float backup_x = x;
DragPoint(x, y, ...);
x = backup_x;Constrain in-callI think this is the solution that would lead to the best user experience (there would be no jitter when the user is dragging the point fast), but for that, you would need to implement your own You can find the It would be nice also to give the LLM the |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the response I have already implemented the constrain after call method and it seems adequate for my proof of concept. I will look into the in-call option if I move forward with my project. |
Beta Was this translation helpful? Give feedback.
I don't think there is a built-in way of constraining
DragPointso that X coordinate is fixed. I can think of two approaches to implement this.Constrain after call
You could always return the X value to the previous value after
DragPointis called. This would probably lead to some visual artifacts if the point is being dragged too fastConstrain in-call
I think this is the solution that would lead to the best user experience (there would be no jitter when the user is dragging the point fast), but for that, you would need to implement your own
DragPointmethod (ask an LLM for help!). The x argument would probably beconst double xin…