From 2218d3bd7334ee7018fa269a285dd8c28dff32e9 Mon Sep 17 00:00:00 2001 From: Qingping Hou Date: Sun, 3 Feb 2013 13:10:11 +0800 Subject: [PATCH] add getScreenMode in screen.lua --- frontend/ui/screen.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/ui/screen.lua b/frontend/ui/screen.lua index 3f5d7bfdd..9586bfb82 100644 --- a/frontend/ui/screen.lua +++ b/frontend/ui/screen.lua @@ -99,6 +99,14 @@ function Screen:getRotationMode() return self.cur_rotation_mode end +function Screen:getScreenMode() + if self.width > self.height then + return "landscape" + else + return "portrait" + end +end + function Screen:setRotationMode(mode) if mode > 3 or mode < 0 then return @@ -128,7 +136,6 @@ function Screen:setViewMode(mode) end end - --[[ @brief change gesture's x and y coordinates according to screen view mode @@ -142,6 +149,7 @@ function Screen:adjustGesCoordinate(ges) end if self.cur_rotation_mode == 1 then + --@TODO fix wipe direction 03.02 2013 (houqp) ges.pos.x, ges.pos.y = (self.width - ges.pos.y), (ges.pos.x) end