From 11bb9009fa74a20f1cf1eee27df46a1c290bf26e Mon Sep 17 00:00:00 2001 From: HW Date: Tue, 26 Nov 2013 16:04:20 +0100 Subject: [PATCH] replace Screen.width/Screen.height with accessor methods Screen.width and Screen.height are now gone, use the methods getWidth() and getHeight() to get the relevant data. They will take blitbuffer/framebuffer rotation into account. --- frontend/ui/gesturedetector.lua | 4 ++-- frontend/ui/input.lua | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/frontend/ui/gesturedetector.lua b/frontend/ui/gesturedetector.lua index 1086ab555..cfe0e8b5a 100644 --- a/frontend/ui/gesturedetector.lua +++ b/frontend/ui/gesturedetector.lua @@ -575,7 +575,7 @@ function GestureDetector:adjustGesCoordinate(ges) if Screen.cur_rotation_mode == 1 then -- in landscape mode rotated 270 if ges.pos then - ges.pos.x, ges.pos.y = (Screen.width - ges.pos.y), (ges.pos.x) + ges.pos.x, ges.pos.y = (Screen:getWidth() - ges.pos.y), (ges.pos.x) end if ges.ges == "swipe" or ges.ges == "pan" or ges.ges == "two_finger_swipe" @@ -612,7 +612,7 @@ function GestureDetector:adjustGesCoordinate(ges) elseif Screen.cur_rotation_mode == 3 then -- in landscape mode rotated 90 if ges.pos then - ges.pos.x, ges.pos.y = (ges.pos.y), (Screen.height - ges.pos.x) + ges.pos.x, ges.pos.y = (ges.pos.y), (Screen:getHeight() - ges.pos.x) end if ges.ges == "swipe" or ges.ges == "pan" or ges.ges == "two_finger_swipe" diff --git a/frontend/ui/input.lua b/frontend/ui/input.lua index 0c9955523..ba2a9d84d 100644 --- a/frontend/ui/input.lua +++ b/frontend/ui/input.lua @@ -330,10 +330,10 @@ function Input:init() ev.code = ABS_X -- We always have to substract from the physical x, -- regardless of the orientation - if (Screen.width