/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali/public-api/common/dali-common.h>
#include <dali/public-api/math/vector2.h>
#include <dali/public-api/math/radian.h>
+#include <dali/public-api/actors/actor.h>
#include <dali/internal/event/actors/actor-impl.h>
#include <dali/internal/event/common/property-notification-manager.h>
#include <dali/internal/event/common/object-impl.h>
UpdateManager& updateManager = tls.GetUpdateManager();
- StagePtr stage = Stage::GetCurrent();
- if( stage )
- {
- PropertyNotificationManager& propertyNotificationManager = stage->GetPropertyNotificationManager();
- PropertyNotificationPtr propertyNotification = new PropertyNotification(updateManager,
- propertyNotificationManager,
- target,
- componentIndex,
- condition);
- return propertyNotification;
- }
- else
- {
- return NULL;
- }
+ PropertyNotificationManager& propertyNotificationManager = tls.GetPropertyNotificationManager();
+ PropertyNotificationPtr propertyNotification = new PropertyNotification(updateManager,
+ propertyNotificationManager,
+ target,
+ componentIndex,
+ condition);
+ return propertyNotification;
}
PropertyNotification::PropertyNotification( UpdateManager& updateManager,
mPropertyType( Property::NONE ),
mComponentIndex( componentIndex ),
mCondition( condition ),
- mNotifyMode( Dali::PropertyNotification::NotifyOnTrue ),
- mNotifyResult( false )
+ mNotifyMode( Dali::PropertyNotification::NOTIFY_ON_TRUE ),
+ mNotifyResult( false ),
+ mCompare( false )
{
const Internal::PropertyCondition& conditionImpl = GetImplementation( condition );
}
}
- // Check if target scene-object already present, and if so create our notification
- // scene-object
- const SceneGraph::PropertyOwner* object = mObject->GetSceneObject();
- if (object)
+ // In Size Property case, swapping components occurs sometimes.
+ // To cover swapping components, previous and current components should be compared.
+ if( mObjectPropertyIndex == Dali::Actor::Property::SIZE
+ && mObject->GetPropertyType(mObjectPropertyIndex) == Property::VECTOR3 )
+ {
+ mCompare = true;
+ for( int i = 0; i < 3; ++i )
{
- CreateSceneObject();
+ mRawConditionArgs.PushBack( 0.0f );
}
}
+ // all objects always have scene object
+ CreateSceneObject();
+ }
+
// Connect to the property notification manager
mPropertyNotificationManager.PropertyNotificationCreated( *this );
}
mComponentIndex,
GetImplementation( mCondition ).type,
mRawConditionArgs,
- mNotifyMode );
+ mNotifyMode,
+ mCompare );
OwnerPointer< SceneGraph::PropertyNotification > transferOwnership( const_cast<SceneGraph::PropertyNotification*>( mPropertyNotification ) );
AddPropertyNotificationMessage( mUpdateManager, transferOwnership );
}