diff --git a/js/gamepad.js b/js/gamepad.js index c2a4e5c..01fbd51 100644 --- a/js/gamepad.js +++ b/js/gamepad.js @@ -192,6 +192,8 @@ function updateVisualStatus() { return; } + requestAnimationFrame(updateVisualStatus); + var button; var $button; for (var buttonIndex = 0; buttonIndex < activeGamepad.buttons.length; buttonIndex++) { @@ -234,8 +236,6 @@ function updateVisualStatus() { updateAxis($axis); } } - - requestAnimationFrame(updateVisualStatus); } function changeGamepadColor(gamepadColor) { @@ -291,7 +291,7 @@ function changeZoom(zoomLevel) { activeGamepadZoomLevel = zoomLevel; } - // hack: fix floatjs float issues + // hack: fix js float issues activeGamepadZoomLevel = +activeGamepadZoomLevel.toFixed(1); $gamepad.css('transform', 'translate(-50%, -50%) scale(' + activeGamepadZoomLevel + ', ' + activeGamepadZoomLevel + ')'); diff --git a/templates/ds4/template.html b/templates/ds4/template.html index ad44d30..58d6815 100644 --- a/templates/ds4/template.html +++ b/templates/ds4/template.html @@ -1,5 +1,5 @@ - +
diff --git a/templates/xbox-one/template.html b/templates/xbox-one/template.html index 21f5ae1..65c415f 100644 --- a/templates/xbox-one/template.html +++ b/templates/xbox-one/template.html @@ -1,5 +1,5 @@ - +