From c396e551eb21c71aac5d568be52dcc38e1f0b01a Mon Sep 17 00:00:00 2001 From: Tyler Hallada Date: Thu, 3 Aug 2017 23:04:30 -0400 Subject: [PATCH] Fix click not working after mouse leaves document --- js/field.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/field.js b/js/field.js index c298d71..8c5b512 100644 --- a/js/field.js +++ b/js/field.js @@ -597,7 +597,7 @@ function loopStart () { disconnectedColorShiftAmt = 10; polygon = new window.PIXI.Graphics(); tweeningFns = tweeningSets.meandering; - startPoints = getRandomPoints(Math.round(totalScreenPixels / 6), screenWidth, screenHeight, tweeningFns); + startPoints = getRandomPoints(3, screenWidth, screenHeight, tweeningFns); polygonPoints = { original: startPoints, target: JSON.parse(JSON.stringify(startPoints)), @@ -631,6 +631,7 @@ window.addEventListener('mousewheel', function (e) { window.addEventListener('touchstart', function (e) { click = getMousePos(e.changedTouches[0], resolution); + clickEnd = false; }); window.addEventListener('touchmove', function (e) { @@ -649,6 +650,7 @@ window.addEventListener('touchcancel', function (e) { window.addEventListener('mousedown', function (e) { click = getMousePos(e, resolution); + clickEnd = false; }); window.addEventListener('mousemove', function (e) {