Skip to content
Discussion options

You must be logged in to vote

I don't think there is a built-in way of constraining DragPoint so 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 DragPoint is called. This would probably lead to some visual artifacts if the point is being dragged too fast

float backup_x = x;
DragPoint(x, y, ...);
x = backup_x;

Constrain 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 DragPoint method (ask an LLM for help!). The x argument would probably be const double x in…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by brenocq
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants