Fix Rotation
authorChoi Munseok <ms47.choi@samsung.com>
Sat, 6 Apr 2013 05:35:08 +0000 (14:35 +0900)
committerChoi Munseok <ms47.choi@samsung.com>
Sat, 6 Apr 2013 05:35:08 +0000 (14:35 +0900)
Change-Id: I2c9df6fc512c3be3d322505748671fa3084b8301
Signed-off-by: Choi Munseok <ms47.choi@samsung.com>
src/ui/FUi_ControlImplManager.cpp [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index d7dd8e3..010be09
@@ -289,6 +289,39 @@ _ControlImplManager::GetOrientationStatus(Orientation mode) const
 
        if (mode == ORIENTATION_AUTOMATIC)
        {
+               // device : 180 degree
+               // return the previous orientation status
+
+               _ControlManager* pCore = _ControlManager::GetInstance();
+               if (pCore)
+               {
+                       _ControlRotation controlRotation = pCore->GetScreenRotation();
+                       if (controlRotation == _CONTROL_ROTATION_180)
+                       {
+                               OrientationStatus prevOrientationStatus = ORIENTATION_STATUS_NONE;
+
+                               _ControlRotation prevRotation = pCore->GetOrientationStatus();
+                               switch (prevRotation)
+                               {
+                               case _CONTROL_ROTATION_0:
+                                       // fall through
+                               case _CONTROL_ROTATION_180:
+                                       prevOrientationStatus = ORIENTATION_STATUS_PORTRAIT;
+                                       break;
+                               case _CONTROL_ROTATION_90:
+                                       prevOrientationStatus = ORIENTATION_STATUS_LANDSCAPE_REVERSE;
+                                       break;
+                               case _CONTROL_ROTATION_270:
+                                       prevOrientationStatus = ORIENTATION_STATUS_LANDSCAPE;
+                                       break;
+                               default:
+                                       break;
+                               }
+
+                               return prevOrientationStatus;
+                       }
+               }
+       
                return ::Convert(screenRotation, false);
        }