08-31-2021 01:16 AM
A cursor with free mode is put on the plot of the x-y graph(both x and y starts from 0 to its maximum scope). When the user drags the cursor, the cursor could either move across the zero point to the negative on the left or over the maximum on the right.
How do I limit the dragging between 0 and the maximum of x or y axis ? I am an newbie and will appreciate of telling me which property of cursor is used for this ?
08-31-2021 01:44 AM
08-31-2021 03:31 AM - edited 08-31-2021 03:34 AM
@rqin wrote:
A cursor with free mode is put on the plot of the x-y graph(both x and y starts from 0 to its maximum scope). When the user drags the cursor, the cursor could either move across the zero point to the negative on the left or over the maximum on the right.
How do I limit the dragging between 0 and the maximum of x or y axis ? I am an newbie and will appreciate of telling me which property of cursor is used for this ?
Disabling the scrolling is probably what you want.
If you really want to limit cursor range, you can catch the Cursor Move event, and write the clipped cursor position:
Things will look ugly, as the clip happens after the fact. So, the scales will still move automatically.
You can work around that too, by making a dummy cursor, dummy scales, and synchronize them. If done correctly, the user won't know any better, but it's a lot of code...
The benefit is that you can clip to arbitrary ranges (or even arbitrary shapes). The clipping logic is separated from the scale.