Prevent the cursor from being stuck on the most outer edges of the screen

This commit is contained in:
Thijs Wenker 2018-06-01 02:07:02 +02:00
parent a06c9eccca
commit 3779a4780e

View file

@ -316,18 +316,18 @@ CameraManager = function() {
var newY = y; var newY = y;
var updatePosition = false; var updatePosition = false;
if (x < 0) { if (x <= 0) {
newX = Window.innerWidth; newX = Window.innerWidth;
updatePosition = true; updatePosition = true;
} else if (x > Window.innerWidth) { } else if (x >= Window.innerWidth) {
newX = 0; newX = 0;
updatePosition = true; updatePosition = true;
} }
if (y < 0) { if (y <= 0) {
newY = Window.innerHeight; newY = Window.innerHeight;
updatePosition = true; updatePosition = true;
} else if (y > Window.innerHeight) { } else if (y >= Window.innerHeight) {
newY = 0; newY = 0;
updatePosition = true; updatePosition = true;
} }