From 183e0a2e25aa6a67f3fa94842d4789c74044d028 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Wed, 13 Jan 2021 21:43:46 +0100 Subject: [PATCH] Bump android-luajit-launcher (#7137) * Check available width when using a viewport * Mention that available_width should always match width --- frontend/device/android/device.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/device/android/device.lua b/frontend/device/android/device.lua index 4b3fc4e74..e5bcfa723 100644 --- a/frontend/device/android/device.lua +++ b/frontend/device/android/device.lua @@ -321,6 +321,8 @@ function Device:toggleFullscreen() elseif api < 19 and api >= 17 then local width = android.getScreenWidth() local height = android.getScreenHeight() + -- NOTE: Since we don't do HW rotation here, this should always match width + local available_width = android.getScreenAvailableWidth() local available_height = android.getScreenAvailableHeight() local is_fullscreen = android.isFullscreen() android.setFullscreen(not is_fullscreen) @@ -329,7 +331,7 @@ function Device:toggleFullscreen() if is_fullscreen then self:setViewport(0, 0, width, height) else - self:setViewport(0, 0, width, available_height) + self:setViewport(0, 0, available_width, available_height) end else logger.dbg("ignoring fullscreen toggle, reason: legacy api " .. api)