From 7de588e8675370ec87c8f1cc315f74674be2382e Mon Sep 17 00:00:00 2001 From: woo Date: Sun, 23 Jun 2013 17:56:00 +0900 Subject: [PATCH] fix bug about size of OverlayRegion (JIRA TDIS-6306) Change-Id: I1164e842d167899be863e5b17fbb69b9436fd9ab Signed-off-by: woo --- src/ui/controls/FUiCtrl_Form.cpp | 22 ++++++++++++++++++++-- src/ui/controls/FUiCtrl_OverlayPanel.cpp | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/src/ui/controls/FUiCtrl_Form.cpp b/src/ui/controls/FUiCtrl_Form.cpp index 885eac8..6fc21ad 100644 --- a/src/ui/controls/FUiCtrl_Form.cpp +++ b/src/ui/controls/FUiCtrl_Form.cpp @@ -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++) { diff --git a/src/ui/controls/FUiCtrl_OverlayPanel.cpp b/src/ui/controls/FUiCtrl_OverlayPanel.cpp index 0d5d814..3b7a42b 100644 --- a/src/ui/controls/FUiCtrl_OverlayPanel.cpp +++ b/src/ui/controls/FUiCtrl_OverlayPanel.cpp @@ -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; + } } -- 2.7.4