13 lines
258 B
JavaScript
13 lines
258 B
JavaScript
function isInBox(pos, box) {
|
|
return (
|
|
(pos.x > box.x && pos.x < box.x + box.width) &&
|
|
(pos.y > box.y && pos.y < box.y + box.height));
|
|
}
|
|
|
|
function position(event) {
|
|
return {
|
|
x: event.clientX,
|
|
y: event.clientY,
|
|
};
|
|
}
|