fix bug about size of OverlayRegion (JIRA TDIS-6306)
authorwoo <s-w.woo@samsung.com>
Sun, 23 Jun 2013 08:56:00 +0000 (17:56 +0900)
committerwoo <s-w.woo@samsung.com>
Sun, 23 Jun 2013 08:56:09 +0000 (17:56 +0900)
Change-Id: I1164e842d167899be863e5b17fbb69b9436fd9ab
Signed-off-by: woo <s-w.woo@samsung.com>
src/ui/controls/FUiCtrl_Form.cpp
src/ui/controls/FUiCtrl_OverlayPanel.cpp

index 885eac8..6fc21ad 100644 (file)
@@ -478,12 +478,30 @@ _Form::GetOverlayRegionN(const FloatRectangle& rect, OverlayRegionType regionTyp
        {
                overlayPhysicalBoundsF = _CoordinateSystemUtils::Transform(CoordinateSystem::AlignToDevice(overlaylLogicalBoundsF));
                overlayPhysicalBounds = _CoordinateSystemUtils::ConvertToInteger(overlayPhysicalBoundsF);
+
+               int unitWidth = OverlayRegion::GetWidthUnit();
+               if(overlayPhysicalBounds.width % unitWidth == 1)
+               {
+                       overlayPhysicalBounds.width -= 1;
+               }
+               else if (overlayPhysicalBounds.width % unitWidth == (unitWidth - 1))
+               {
+                       overlayPhysicalBounds.width += 1;
+               }
+
+               int unitHeight = OverlayRegion::GetHeightUnit();
+               if(overlayPhysicalBounds.height % unitHeight == 1)
+               {
+                       overlayPhysicalBounds.height -= 1;
+               }
+               else if (overlayPhysicalBounds.height % unitHeight == (unitHeight - 1))
+               {
+                       overlayPhysicalBounds.height += 1;
+               }
        }
        SysSecureLog(NID_UI_CTRL, "The current bounds of overlay region is [%.3f, %.3f, %.3f, %.3f]"
                , overlaylLogicalBoundsF.x, overlaylLogicalBoundsF.y, overlaylLogicalBoundsF.width, overlaylLogicalBoundsF.height);
 
-
-
        //Check for using OverlayPanel simutaneously
        for (int index = 0; index < GetChildCount(); index++)
        {
index 0d5d814..3b7a42b 100644 (file)
@@ -205,6 +205,26 @@ _OverlayPanel::OnAttachedToMainTree(void)
 
                FloatRectangle physicalBoundsF = _CoordinateSystemUtils::Transform(CoordinateSystem::AlignToDevice(logicalBoundsF));
                physicalBounds = _CoordinateSystemUtils::ConvertToInteger(physicalBoundsF);
+
+               int unitWidth = _OverlayAgent::GetWidthUnit();
+               if(physicalBounds.width % unitWidth == 1)
+               {
+                       physicalBounds.width -= 1;
+               }
+               else if (physicalBounds.width % unitWidth == (unitWidth - 1))
+               {
+                       physicalBounds.width += 1;
+               }
+
+               int unitHeight = _OverlayAgent::GetHeightUnit();
+               if(physicalBounds.height % unitHeight == 1)
+               {
+                       physicalBounds.height -= 1;
+               }
+               else if (physicalBounds.height % unitHeight == (unitHeight - 1))
+               {
+                       physicalBounds.height += 1;
+               }
        }