web limit mouse position

This commit is contained in:
Devaev Maxim 2019-07-16 03:20:18 +03:00
parent 7b98777ed0
commit 3cd2e7bb52

View File

@ -136,8 +136,8 @@ export function Mouse() {
var __streamMoveHandler = function(event) { var __streamMoveHandler = function(event) {
let rect = event.target.getBoundingClientRect(); let rect = event.target.getBoundingClientRect();
__current_pos = { __current_pos = {
x: Math.round(event.clientX - rect.left), x: Math.min(Math.round(event.clientX - rect.left), 0),
y: Math.round(event.clientY - rect.top), y: Math.min(Math.round(event.clientY - rect.top), 0),
}; };
}; };