From 133019fc865bf6902abfc627f816a7d80a0c1443 Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Mon, 3 Aug 2020 19:51:09 +0200 Subject: [PATCH] try to move joysticks to correct position after orientation change --- raspberry/roberto/views/frontend/templates/gamepad.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/raspberry/roberto/views/frontend/templates/gamepad.js b/raspberry/roberto/views/frontend/templates/gamepad.js index b561e0c..5f3afd0 100644 --- a/raspberry/roberto/views/frontend/templates/gamepad.js +++ b/raspberry/roberto/views/frontend/templates/gamepad.js @@ -154,3 +154,8 @@ setInterval(function(){ } } }, 50); + +window.addEventListener("orientationchange", function(event) { + joystick._updatePositionOfContainer(); + joystick2._updatePositionOfContainer(); +});