Fix bug in capturing on WVGA emulator
authorjisun10.lee <jisun10.lee@samsung.com>
Fri, 22 Mar 2013 13:29:50 +0000 (22:29 +0900)
committerjisun10.lee <jisun10.lee@samsung.com>
Fri, 22 Mar 2013 13:31:43 +0000 (22:31 +0900)
Change-Id: I51420f2459219fdeed4ba48625c6a721d4a6d5d3
Signed-off-by: jisun10.lee <jisun10.lee@samsung.com>
src/ui/animations/FUiAnim_VisualElementImpl.cpp
src/ui/inc/FUiAnim_VisualElementCoordinateSystem.h

index 032f2b9..4506f6e 100644 (file)
@@ -6370,7 +6370,6 @@ _VisualElementImpl::CaptureI(Canvas& outputCanvas, const FloatRectangle& rectDes
 
        FloatRectangle tempRect = drawRect;
 
-
        drawRect.x -= bounds.x;
        drawRect.y -= bounds.y;  //--> 0 - -20  = 20  : 20 - 20 = 0
 
@@ -6443,11 +6442,16 @@ _VisualElementImpl::CaptureI(Canvas& outputCanvas, const FloatRectangle& rectDes
                                                                if (pBitmap)
                                                                {
                                                                        pBitmap->SetAlphaConstant((int)(pRenderTarget->GetOpacityFromRoot() * 255.0f));
-                                                                       Rectangle outputR(drawRect.x, drawRect.y, drawRect.width, drawRect.height);
-                                                                       Rectangle srcRect =  outputR;
-                                                                       outputR.x = rectDest.x + bounds.x;
-                                                                       outputR.y = rectDest.y + bounds.y;
-                                                                       outputCanvas.DrawBitmap(outputR, *pBitmap, srcRect);
+                                                                       FloatRectangle outputRect(rectDest.x + bounds.x, rectDest.y + bounds.y, drawRect.width, drawRect.height);
+                                                                       _VisualElementCoordinateSystem::ConvertRectangleToPhysicalIntegral(outputRect.x, outputRect.y, outputRect.width, outputRect.height);
+                                                                       _VisualElementCoordinateSystem::ConvertRectangleToLogical(outputRect.x, outputRect.y, outputRect.width, outputRect.height);
+
+                                                                       FloatRectangle srcRect(drawRect.x, drawRect.y, info.width, info.height);
+                                                                       _VisualElementCoordinateSystem::ConvertDimensionToLogical(srcRect.width, srcRect.height);
+
+                                                                       Rectangle outputR(outputRect.x, outputRect.y, outputRect.width, outputRect.height);
+                                                                       Rectangle srcR(srcRect.x, srcRect.y, srcRect.width, srcRect.height);
+                                                                       outputCanvas.DrawBitmap(outputR, *pBitmap, srcR);
 
                                                                        delete pBitmap;
                                                                }
index e218bad..c571e46 100644 (file)
@@ -73,7 +73,7 @@ public:
                if (unlikely(needScale))
                {
                        ConvertPointToPhysical(x, y);
-                       ConvertDimensionToPhysical(width, height);;
+                       ConvertDimensionToPhysical(width, height);
                }
        }
 
@@ -100,6 +100,18 @@ public:
                intHeight = static_cast< int >(height);
        }
 
+       static void ConvertRectangleToPhysicalIntegral(float& x, float& y, float& width, float& height)
+       {
+               if (unlikely(needScale))
+               {
+                       ConvertPointToPhysical(x, y);
+                       ConvertDimensionToPhysical(width, height);
+               }
+
+               MakeIntegralPoint(x, y);
+               MakeIntegralDimension(width, height);
+       }
+
        static void ConvertDimensionToLogicalIntegral(float& width, float& height)
        {
                if (unlikely(needScale))
@@ -123,6 +135,18 @@ public:
                intHeight = static_cast< int >(height);
        }
 
+       static void ConvertRectangleToLogicalIntegral(float& x, float& y, float& width, float& height)
+       {
+               if (unlikely(needScale))
+               {
+                       ConvertPointToLogical(x, y);
+                       ConvertDimensionToLogical(width, height);
+               }
+
+               MakeIntegralPoint(x, y);
+               MakeIntegralDimension(width, height);
+       }
+
        static void ConvertDimensionToLogical(float& width, float& height)
        {
                if (unlikely(needScale))
@@ -132,6 +156,15 @@ public:
                }
        }
 
+       static void ConvertRectangleToLogical(float& x, float& y, float& width, float& height)
+       {
+               if (unlikely(needScale))
+               {
+                       ConvertPointToLogical(x, y);
+                       ConvertDimensionToLogical(width, height);
+               }
+       }
+
        static void ConvertPointToPhysical(float& x, float& y)
        {
                if (unlikely(needScale))