From: Choi Munseok Date: Thu, 20 Jun 2013 10:16:21 +0000 (+0900) Subject: Fixed to move the mini mode Frame X-Git-Tag: accepted/tizen/20130924.144426~1^2~473^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=22869e9118cdd2785702bf7641ec292e0672070b;p=platform%2Fframework%2Fnative%2Fuifw.git Fixed to move the mini mode Frame Change-Id: I89eb17206c42375a7fa52cb6c1894d2e8a691826 Signed-off-by: Choi Munseok --- diff --git a/src/ui/controls/FUiCtrl_FormImpl.cpp b/src/ui/controls/FUiCtrl_FormImpl.cpp index 7ede3b3..612b39d 100644 --- a/src/ui/controls/FUiCtrl_FormImpl.cpp +++ b/src/ui/controls/FUiCtrl_FormImpl.cpp @@ -1154,7 +1154,6 @@ _FormImpl::OnChangeLayout(_ControlOrientation orientation) FloatDimension portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSizeF(); FloatDimension landscapeSize = FloatDimension(portraitSize.height, portraitSize.width); - // Adjust the position of the partial Frame. _FrameImpl* pFrameImpl = dynamic_cast<_FrameImpl*>(GetParent()); if (pFrameImpl) { @@ -1166,55 +1165,36 @@ _FormImpl::OnChangeLayout(_ControlOrientation orientation) pFrameImpl->GetCore().SetMovable(true); FloatPoint prevPoint = pFrameImpl->GetPositionF(); - - FloatPoint curPoint(0.0f, 0.0f); - + FloatPoint curPoint(prevPoint.x, prevPoint.y); + float ratio = portraitSize.width / portraitSize.height; if (orientation == _CONTROL_ORIENTATION_PORTRAIT) { - if (prevPoint.x < 0.0f) - { - curPoint.x = portraitSize.height / portraitSize.width * prevPoint.x; - } - else + if (prevPoint.x > 0.0f) { - curPoint.x = portraitSize.width / portraitSize.height * prevPoint.x; + curPoint.x = prevPoint.x * ratio; } - if (prevPoint.y < 0.0f) - { - curPoint.y = portraitSize.width / portraitSize.height * prevPoint.y; - } - else + if (prevPoint.y > 0.0f) { - curPoint.y = portraitSize.height / portraitSize.width * prevPoint.y; + curPoint.y = prevPoint.y / ratio; } } else { - if (prevPoint.x < 0.0f) + if (prevPoint.x > 0.0f) { - curPoint.x = portraitSize.width / portraitSize.height * prevPoint.x; - } - else - { - curPoint.x = portraitSize.height / portraitSize.width * prevPoint.x; + curPoint.x = prevPoint.x / ratio; } - if (prevPoint.y < 0.0f) - { - curPoint.y = portraitSize.height / portraitSize.width * prevPoint.y; - } - else + if (prevPoint.y > 0.0f) { - curPoint.y = portraitSize.width / portraitSize.height * prevPoint.y; + curPoint.y = prevPoint.y * ratio; } } pFrameImpl->SetPosition(curPoint); - portraitSize = pFrameImpl->GetSizeF(); landscapeSize = portraitSize; - pFrameImpl->GetCore().SetMovable(movable); } } diff --git a/src/ui/controls/FUiCtrl_FrameImpl.cpp b/src/ui/controls/FUiCtrl_FrameImpl.cpp index dd4e8bb..044102d 100644 --- a/src/ui/controls/FUiCtrl_FrameImpl.cpp +++ b/src/ui/controls/FUiCtrl_FrameImpl.cpp @@ -357,57 +357,38 @@ _FrameImpl::OnChangeLayout(_ControlOrientation orientation) } else if ((frameShowMode == FRAME_SHOW_MODE_PARTIAL_SCREEN) || (frameShowMode == FRAME_SHOW_MODE_PARTIAL_SCREEN_FLOATING)) { - // Adjust the position of the partial Frame. bool movable = IsMovable(); SetMovable(true); FloatPoint prevPoint = GetPositionF(); - - FloatPoint curPoint(0.0f, 0.0f); - + FloatPoint curPoint(prevPoint.x, prevPoint.y); + float ratio = screenSize.width / screenSize.height; if (orientation == _CONTROL_ORIENTATION_PORTRAIT) { - if (prevPoint.x < 0.0f) - { - curPoint.x = screenSize.height / screenSize.width * prevPoint.x; - } - else + if (prevPoint.x > 0.0f) { - curPoint.x = screenSize.width / screenSize.height * prevPoint.x; + curPoint.x = prevPoint.x * ratio; } - - if (prevPoint.y < 0.0f) - { - curPoint.y = screenSize.width / screenSize.height * prevPoint.y; - } - else + + if (prevPoint.y > 0.0f) { - curPoint.y = screenSize.height / screenSize.width * prevPoint.y; + curPoint.y = prevPoint.y / ratio; } } else { - if (prevPoint.x < 0.0f) + if (prevPoint.x > 0.0f) { - curPoint.x = screenSize.width / screenSize.height * prevPoint.x; + curPoint.x = prevPoint.x / ratio; } - else - { - curPoint.x = screenSize.height / screenSize.width * prevPoint.x; - } - - if (prevPoint.y < 0.0f) + + if (prevPoint.y > 0.0f) { - curPoint.y = screenSize.height / screenSize.width * prevPoint.y; - } - else - { - curPoint.y = screenSize.width / screenSize.height * prevPoint.y; + curPoint.y = prevPoint.y * ratio; } } SetPosition(curPoint); - SetMovable(movable); }