You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
\ The word mouse delivers the position of the mouse pointer from the origin x y (0, 0)
\ of the HTML page and not from the origin of the canvas.
\ The word getMousePosition retrieves and recalculates the relative position of the
\ mouse pointer from the origin of the canvas.
JSWORD: getMousePosition { -- mousex mousey }
var offset = {x: 0, y: 0};
var node = context.ctx.canvas;
while (node) {
offset.x += node.offsetLeft;
offset.y += node.offsetTop;
node = node.offsetParent;
}
return [context.mouse_x-offset.x, context.mouse_y-offset.y];
~
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: