display: fix rotation bug
authorGiWoong Kim <giwoong.kim@samsung.com>
Thu, 30 Apr 2015 06:50:07 +0000 (15:50 +0900)
committerGiWoong Kim <giwoong.kim@samsung.com>
Thu, 30 Apr 2015 09:53:53 +0000 (18:53 +0900)
1. display should be updated when rotating
2. calculate with correct orientation for coordinate.

Change-Id: I6f78a9ff0f521668af5461761c5d8ebef100774d
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/ui/displaybase.cpp

index e0185ce..2d10383 100644 (file)
@@ -55,6 +55,7 @@ void DisplayBase::rotate(QRect rect, int angle)
     qt5_window_angle = rotateAngle = angle;
 
     updateGeometry();
+    update();
 
     widget->repaint();
 }
@@ -66,6 +67,7 @@ void DisplayBase::scale(qreal scaleFactor)
     this->scaleFactor = scaleFactor;
 
     updateGeometry();
+    update();
 
     widget->repaint();
 }
@@ -109,14 +111,14 @@ QPoint DisplayBase::getGuestPos(QPoint hostPos)
     switch(rotateAngle) {
     case 90: /* Reverse Landscape */
         guestPos.setX(guestPosY);
-        guestPos.setY(rect.height() - guestPosX);
+        guestPos.setY(rect.width() - guestPosX);
         break;
     case 180: /* Reverse Portrait */
         guestPos.setX(rect.width() - guestPosX);
         guestPos.setY(rect.height() - guestPosY);
         break;
     case 270: /* Landscape */
-        guestPos.setX(rect.width() - guestPosY);
+        guestPos.setX(rect.height() - guestPosY);
         guestPos.setY(guestPosX);
         break;
     case 0: