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.
This commit is contained in:
HW
2013-11-26 16:04:20 +01:00
parent 9d3c27117d
commit 11bb9009fa
2 changed files with 11 additions and 11 deletions

View File

@@ -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<Screen.height) then
ev.value = Screen.width - ev.value
if (Screen:getWidth()<Screen:getHeight()) then
ev.value = Screen:getWidth() - ev.value
else
ev.value = Screen.height - ev.value
ev.value = Screen:getHeight() - ev.value
end
end
-- same thing for multitouch events (phoenix)
@@ -343,10 +343,10 @@ function Input:init()
ev.code = ABS_MT_POSITION_X
-- We always have to substract from the physical x,
-- regardless of the orientation
if (Screen.width<Screen.height) then
ev.value = Screen.width - ev.value
if (Screen:getWidth()<Screen:getHeight()) then
ev.value = Screen:getWidth() - ev.value
else
ev.value = Screen.height - ev.value
ev.value = Screen:getHeight() - ev.value
end
end
end
@@ -359,10 +359,10 @@ function Input:init()
if ev.code == ABS_X then
-- We always have to substract from the physical x,
-- regardless of the orientation
if (Screen.width<Screen.height) then
ev.value = Screen.width - ev.value
if (Screen:getWidth()<Screen:getHeight()) then
ev.value = Screen:getWidth() - ev.value
else
ev.value = Screen.height - ev.value
ev.value = Screen:getHeight() - ev.value
end
end
return ev