Hello,
I try to implement an interactive function that uses mouseX and mouseY. However, I found that mouseX and mouseY always give the positions of the mouse relative to the current extent of canvas.
For example, I can use mouseX and mouseY to check if the mouse cursor is close to a point (say, (100, 100)) on the canvas. However, if I zoom in, mouseX and mouseY will become the distance relative to the upper left point of the NEW extent. In my implementation, what I need to know is still the distance to the original upper left point, no matter how user zoom-in and zoom-out. I am wondering if there is a way to do this.
Any idea is greatly appreciated. Thanks!
I try to implement an interactive function that uses mouseX and mouseY. However, I found that mouseX and mouseY always give the positions of the mouse relative to the current extent of canvas.
For example, I can use mouseX and mouseY to check if the mouse cursor is close to a point (say, (100, 100)) on the canvas. However, if I zoom in, mouseX and mouseY will become the distance relative to the upper left point of the NEW extent. In my implementation, what I need to know is still the distance to the original upper left point, no matter how user zoom-in and zoom-out. I am wondering if there is a way to do this.
Any idea is greatly appreciated. Thanks!
1