From 42890300be93f2f116324ddc52a5cd96d126cddb Mon Sep 17 00:00:00 2001 From: Dae Young Ryu Date: Tue, 22 Oct 2013 18:14:46 +0900 Subject: [PATCH] fixed SetContentBounds bug Change-Id: I4ed78629c0ae2566a9db0cc3f1ca60b2556ac754 Signed-off-by: Dae Young Ryu --- src/ui/animations/FUiAnim_VisualElementImpl.cpp | 85 ++++++------------------- src/ui/inc/FUiAnim_VisualElementImpl.h | 10 +-- 2 files changed, 26 insertions(+), 69 deletions(-) diff --git a/src/ui/animations/FUiAnim_VisualElementImpl.cpp b/src/ui/animations/FUiAnim_VisualElementImpl.cpp index e2c0fad..085f285 100644 --- a/src/ui/animations/FUiAnim_VisualElementImpl.cpp +++ b/src/ui/animations/FUiAnim_VisualElementImpl.cpp @@ -72,9 +72,9 @@ #include "math/FUiAnim_MathVector4.h" #include "math/FUiAnim_MathMatrix4.h" -#ifndef BUILD_UI_CORE -#include "FUiAnim_ControlVisualElement.h" -#endif +//#ifndef BUILD_UI_CORE +//#include "FUiAnim_ControlVisualElement.h" +//#endif #include "FUiAnim_MatrixUtil.h" #include "FUiAnim_Debug.h" @@ -118,11 +118,11 @@ using namespace Tizen::Ui::Animations; #define PRINT(...) //#define PRINT fprintf(stderr, __VA_ARGS__) -#ifndef BUILD_UI_CORE -#define IS_KNOWN_CLASS(_PUBLIC) (likely(typeid(*(_PUBLIC)) == VeTypeId) || likely(typeid(*(_PUBLIC)) == internalVeTypeId) || likely(typeid(*(_PUBLIC)) == controlVeTypeId) || likely(typeid(*(_PUBLIC)) == rootVeTypeId)) -#else +//#ifndef BUILD_UI_CORE +//#define IS_KNOWN_CLASS(_PUBLIC) (likely(typeid(*(_PUBLIC)) == VeTypeId) || likely(typeid(*(_PUBLIC)) == internalVeTypeId) || likely(typeid(*(_PUBLIC)) == controlVeTypeId) || likely(typeid(*(_PUBLIC)) == rootVeTypeId)) +//#else #define IS_KNOWN_CLASS(_PUBLIC) (likely(typeid(*(_PUBLIC)) == VeTypeId) || likely(typeid(*(_PUBLIC)) == internalVeTypeId) || likely(typeid(*(_PUBLIC)) == rootVeTypeId)) -#endif +//#endif #define IS_INTERNAL_CLASS(_IMPL) (likely((_IMPL)->__isInternal)) #define IS_NEEDED_UPDATE_RENDER_OBJECT(__MODEL) (((__MODEL)->__isPropertyPropagationEnabled) && ((__MODEL)->__pRenderObject)) @@ -202,9 +202,9 @@ namespace Tizen { namespace Ui { namespace Animations static const std::type_info& VeTypeId = typeid(VisualElement); static const std::type_info& rootVeTypeId = typeid(_RootVisualElement); static const std::type_info& internalVeTypeId = typeid(_VisualElement); -#ifndef BUILD_UI_CORE -static const std::type_info& controlVeTypeId = typeid(_ControlVisualElement); -#endif +//#ifndef BUILD_UI_CORE +//static const std::type_info& controlVeTypeId = typeid(_ControlVisualElement); +//#endif // declared AnimationEventListener for implicit animation class _VisualElementImplicitAnimationEventListener @@ -346,8 +346,8 @@ private: _VisualElementImpl::_VisualElementImpl(VisualElement& element) : _zOrderGroup(Z_ORDER_GROUP_NORMAL) - , __globalRay(_Math::Vector3(0.0f),_Math::Vector3(0.0f)) , __boundingVolume() + , __globalRay(_Math::Vector3(0.0f),_Math::Vector3(0.0f)) , __hasGlobalRay(false) , __nearestDistance(std::numeric_limits::infinity()) , __pNearestVEImpl(null) @@ -1305,17 +1305,9 @@ _VisualElementImpl::GetPropertyPropagationEnabled(void) const ClearLastResult(); // TBD: forward using property or direct return ? -#if 0 - bool isPropertyPropagationEnabled = InvokeOnGetPropertyRequested(*pVePropPropertyPropagationEnabled).ToBool(); - if (GetLastResult() != E_SUCCESS) - { - return false; - } - return isPropertyPropagationEnabled; -#else return __isPropertyPropagationEnabled; -#endif + } result @@ -1328,17 +1320,6 @@ _VisualElementImpl::SetPropertyPropagationEnabledI(bool enable) __isPropertyPropagationEnabled = enable; -// if (IS_MODEL(this)) -// { -// if (__isPropertyPropagationEnabled) -// { -// AddPropertyChangeEventListener(_VisualElementModelObserver::GetInstance()); -// } -// else -// { -// RemovePropertyChangeEventListener(_VisualElementModelObserver::GetInstance()); -// } -// } return E_SUCCESS; } @@ -1676,7 +1657,15 @@ _VisualElementImpl::SetContentBoundsI(const FloatRectangle& contentBounds) //InvalidateHierarchyProps(HIERARCHY_PROPERTY_CONTENTBOUNDS, false, false); InvalidateHierarchyProps(UPDATED_PROP_CONTENT_BOUNDS, false, false); - GetSharedData().toUpdatePropImmediately.Update(this,UPDATED_PROP_CONTENT_BOUNDS); + // observer + if(IS_MODEL(this) && IS_NEEDED_UPDATE_RENDER_OBJECT(this)) + { + GetSharedData().toUpdatePropImmediately.Update(this,UPDATED_PROP_CONTENT_BOUNDS); + } + else if( IS_PRESENTATION(this)) + { + GetSharedData().toUpdatePropImmediately.Update(this,UPDATED_PROP_CONTENT_BOUNDS); + } return E_SUCCESS; } @@ -8092,38 +8081,6 @@ _VisualElementImpl::CreateAnimationForPropertyI(const Tizen::Base::String& prope return null; } -#if 0 - if (property.CompareTo(String(VePropBounds)) == 0) - { - //ToDo: default implementation - } - else if (property.CompareTo(String(VePropOpacity)) == 0) - { - //ToDo: default implementation - } - else if (property.CompareTo(String(VePropChildrenOpacity)) == 0) - { - //ToDo: default implementation - } - else if (property.CompareTo(String(VePropShowState)) == 0) - { - //ToDo: default implementation - } - else if (property.CompareTo(String(VePropTransform)) == 0) - { - //ToDo: default implementation - } - else if (property.CompareTo(String(VePropChildrenTransform)) == 0) - { - //ToDo: default implementation - } - else if (property.CompareTo(String(VePropZPosition)) == 0) - { - //ToDo: default implementation - } - else - return null; -#endif VisualElementPropertyAnimation* pAnimation = new (std::nothrow) VisualElementPropertyAnimation(); SysTryReturn(NID_UI_ANIM, pAnimation != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); diff --git a/src/ui/inc/FUiAnim_VisualElementImpl.h b/src/ui/inc/FUiAnim_VisualElementImpl.h index 88d14f4..41efa1a 100644 --- a/src/ui/inc/FUiAnim_VisualElementImpl.h +++ b/src/ui/inc/FUiAnim_VisualElementImpl.h @@ -1421,8 +1421,8 @@ private: bool CreateImplicitAnimationIfNeeded(const Tizen::Base::String& property, const Variant& newValue, const Variant& currentPresntationValue, const Tizen::Base::String** pSubProperties, bool isCustomProperty = false); //Visual Element Bounding volume related - result AdjustBoundingVolume(); - BoundingVolume& GetBoundingVolume(); + result AdjustBoundingVolume(void); + BoundingVolume& GetBoundingVolume(void); //Picking instruments result GetChildListAt(const Tizen::Graphics::FloatPoint& point, Tizen::Base::Collection::IList* list); @@ -1494,9 +1494,9 @@ public: private: //Visual Element Bounding volume related - void __AdjustBVWithChildren(); - void __AdjustParentsBV(); - void __MergeParentsBV(); + void __AdjustBVWithChildren(void); + void __AdjustParentsBV(void); + void __MergeParentsBV(void); //picking related methods and variables -- 2.7.4