MouseDown event x y postions when scrolled

The docs say that the x y positions are “local to the control”. I understood this to mean to the upper left hand corner of the CONTROL in which the mousedown event occured.

I have a canvas with only it’s top and left sides locked (fixed width) inside of a container with all sides locked. This setup gives me a horizontal scroll bar when the browser window does not contain the canvas completely.

If I scroll horizontally or vertically such that 100 pixels of the container’s left or top sides (and canvas) are no longer visible within the browser, I expected that if I clicked 10 pixels from the left or top side of the browser window x or y would be 110, but it returns 10.

Perhaps having the canvas in a control is messing things up for me?

How can I get the x y coordinates of a mouse down event to always be relative the control, in this case the canvas, whether or not it is scrolled.

Bottom line is in order to respond to the mouse down event properly I have to know where in the canvas the event took place, If 100 pixels from the left side of the canvas then 100 whether theh left side is off screen or not.

Someone correct me if I am wrong. “Local to the control” must be without regard to it’s physical position in the browser window. ie. it is relative to the control as placed in design.

After playing with this for a while, the only way I can see to get the mousedown coordinates is to calculate it, but to do that I would need the scroll positions. I don’t see any way to get the scroll positions of a control, or anything else.

Is it even possible to get the mousedown coordinates relative to the control even when scrolled?