From: Keuckdo Bang Date: Mon, 18 Mar 2013 04:43:51 +0000 (+0900) Subject: Fixed assert because comparing the float and int. X-Git-Tag: accepted/tizen_2.1/20130425.033138~867^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d4b1ed19b6e5946f4a086092412aa80ef08f5317;p=platform%2Fframework%2Fnative%2Fuifw.git Fixed assert because comparing the float and int. Change-Id: Ie4d3f15d4aed6fe75c513a61c773791f39f8e58f --- diff --git a/src/ui/FUi_Control.cpp b/src/ui/FUi_Control.cpp index 9a5b933..2686d83 100644 --- a/src/ui/FUi_Control.cpp +++ b/src/ui/FUi_Control.cpp @@ -402,7 +402,7 @@ public: result SetItemBounds(const FloatRectangle& rect) { - SysAssert(__pControl->IsInSizeRange(Dimension(_CoordinateSystemUtils::ConvertToInteger(rect.width), _CoordinateSystemUtils::ConvertToInteger(rect.height)))); + SysAssert(__pControl->IsInSizeRange(FloatDimension(rect.width, rect.height))); return __pControl->SetBoundsFinal(rect, false, true); } @@ -2884,7 +2884,14 @@ _Control::UpdateBoundsOfVisualElement(const FloatRectangle& controlBounds) } bool -_Control::IsInSizeRange(const Dimension& size) +_Control::IsInSizeRange(const Dimension& size) const +{ + return (__minSize.width <= size.width) && (size.width <= __maxSize.width) && + (__minSize.height <= size.height) && (size.height <= __maxSize.height); +} + +bool +_Control::IsInSizeRange(const FloatDimension& size) const { return (__minSize.width <= size.width) && (size.width <= __maxSize.width) && (__minSize.height <= size.height) && (size.height <= __maxSize.height); diff --git a/src/ui/inc/FUi_Control.h b/src/ui/inc/FUi_Control.h index 642a282..931e4fb 100644 --- a/src/ui/inc/FUi_Control.h +++ b/src/ui/inc/FUi_Control.h @@ -538,7 +538,8 @@ private: void ReleaseHandle(void); - bool IsInSizeRange(const Tizen::Graphics::Dimension& size); + bool IsInSizeRange(const Tizen::Graphics::Dimension& size) const; + bool IsInSizeRange(const Tizen::Graphics::FloatDimension& size) const; result AdjustSizeToRange(void); result SetBoundsInternal(const Tizen::Graphics::FloatRectangle& bounds, bool callBoundsChangeCallbacks, bool callUpdateBoundsOfVisualElement = true); result SetBoundsFinal(const Tizen::Graphics::FloatRectangle& newBounds, bool changeLayoutBaseRect, bool callBoundsChangeCallbacks, bool callUpdateBoundsOfVisualElement = true);