END_TEST;
}
-int UtcDaliActorTouchDelegateAreaPropertyP(void)
+int UtcDaliActorTouchAreaPropertyP(void)
{
TestApplication application;
Actor actor = Actor::New();
- Vector2 touchDelegateArea = actor.GetProperty(DevelActor::Property::TOUCH_DELEGATE_AREA).Get<Vector2>();
- DALI_TEST_EQUALS(touchDelegateArea, Vector2::ZERO, TEST_LOCATION);
- actor.SetProperty(DevelActor::Property::TOUCH_DELEGATE_AREA, Vector2(10.f, 10.f));
- touchDelegateArea = actor.GetProperty(DevelActor::Property::TOUCH_DELEGATE_AREA).Get<Vector2>();
- DALI_TEST_EQUALS(touchDelegateArea, Vector2(10.f, 10.f), TEST_LOCATION);
+ Vector2 touchArea = actor.GetProperty(DevelActor::Property::TOUCH_AREA).Get<Vector2>();
+ DALI_TEST_EQUALS(touchArea, Vector2::ZERO, TEST_LOCATION);
+ actor.SetProperty(DevelActor::Property::TOUCH_AREA, Vector2(10.f, 10.f));
+ touchArea = actor.GetProperty(DevelActor::Property::TOUCH_AREA).Get<Vector2>();
+ DALI_TEST_EQUALS(touchArea, Vector2(10.f, 10.f), TEST_LOCATION);
END_TEST;
}
-int UtcDaliActorTouchDelegateAreaPropertyN(void)
+int UtcDaliActorTouchAreaPropertyN(void)
{
TestApplication application;
// Make sure setting invalid types does not cause a crash
try
{
- actor.SetProperty(DevelActor::Property::TOUCH_DELEGATE_AREA, 1.0f);
- actor.SetProperty(DevelActor::Property::TOUCH_DELEGATE_AREA, Vector2::ONE);
- actor.SetProperty(DevelActor::Property::TOUCH_DELEGATE_AREA, Vector3::ONE);
- actor.SetProperty(DevelActor::Property::TOUCH_DELEGATE_AREA, Vector4::ONE);
- actor.SetProperty(DevelActor::Property::TOUCH_DELEGATE_AREA, Property::Map());
- actor.SetProperty(DevelActor::Property::TOUCH_DELEGATE_AREA, Property::Array());
+ actor.SetProperty(DevelActor::Property::TOUCH_AREA, 1.0f);
+ actor.SetProperty(DevelActor::Property::TOUCH_AREA, Vector2::ONE);
+ actor.SetProperty(DevelActor::Property::TOUCH_AREA, Vector3::ONE);
+ actor.SetProperty(DevelActor::Property::TOUCH_AREA, Vector4::ONE);
+ actor.SetProperty(DevelActor::Property::TOUCH_AREA, Property::Map());
+ actor.SetProperty(DevelActor::Property::TOUCH_AREA, Property::Array());
tet_result(TET_PASS);
}
catch(...)
END_TEST;
}
-int UtcDaliTouchDelegateArea(void)
+int UtcDaliTouchArea(void)
{
TestApplication application;
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
data.Reset();
- // set a bigger touch delegate area
- actor.SetProperty(DevelActor::Property::TOUCH_DELEGATE_AREA, Vector2(200.0f, 200.0f));
+ // set a bigger touch area
+ actor.SetProperty(DevelActor::Property::TOUCH_AREA, Vector2(200.0f, 200.0f));
// Render and notify
application.SendNotification();
// Emit a down signal
application.ProcessEvent(GenerateSingleTouch(PointState::DOWN, Vector2(110.0f, 110.0f)));
- // The actor touched signal is called because the touch area is inside touchDelegateArea.
+ // The actor touched signal is called because the touch area is inside touchArea.
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(PointState::DOWN, data.receivedTouch.points[0].state, TEST_LOCATION);
DALI_TEST_CHECK(actor == data.receivedTouch.points[0].hitActor);
data.Reset();
- // set a smaller touch delegate area
- actor.SetProperty(DevelActor::Property::TOUCH_DELEGATE_AREA, Vector2(50.0f, 50.0f));
+ // set a smaller touch area
+ actor.SetProperty(DevelActor::Property::TOUCH_AREA, Vector2(50.0f, 50.0f));
// Render and notify
application.SendNotification();
// Emit a down signal
application.ProcessEvent(GenerateSingleTouch(PointState::DOWN, Vector2(80.0f, 80.0f)));
- // The actor touched signal is not called because the touch area is outside touchDelegateArea.
+ // The actor touched signal is not called because the touch area is outside touchArea.
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
data.Reset();
// Emit a down signal
application.ProcessEvent(GenerateSingleTouch(PointState::DOWN, Vector2(30.0f, 30.0f)));
- // The actor touched signal is called because the touch area is inside touchDelegateArea.
+ // The actor touched signal is called because the touch area is inside touchArea.
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(PointState::DOWN, data.receivedTouch.points[0].state, TEST_LOCATION);
DALI_TEST_CHECK(actor == data.receivedTouch.points[0].hitActor);
CAPTURE_ALL_TOUCH_AFTER_START,
/**
- * @brief If you set the TOUCH_DELEGATE_AREA on an actor, when you touch the actor, the delegate area is used rather than the size of the actor
- * @details Name "touchDelegateArea", type Property::Vector2
+ * @brief If you set the TOUCH_AREA on an actor, when you touch the actor, the touch area is used rather than the size of the actor
+ * @details Name "touchArea", type Property::Vector2
* @note Default is Vector2::ZERO.
* @note for example
* Actor actor = Actor::New();
* actor.SetProperty(Actor::Property::SIZE, Vector2(10.0f, 10.0f));
- * actor.SetProperty(DevelActor::Property::TOUCH_DELEGATE_AREA, Vector2(200.0f, 200.0f));
+ * actor.SetProperty(DevelActor::Property::TOUCH_AREA, Vector2(200.0f, 200.0f));
* actor.TouchedSignal().Connect(OnTouchCallback);
*
- * If you want to reset the touch area to an area different with the size of the actor, you can set this TOUCH_DELEGATE_AREA property.
+ * If you want to reset the touch area to an area different with the size of the actor, you can set this TOUCH_AREA property.
*/
- TOUCH_DELEGATE_AREA
+ TOUCH_AREA
};
} // namespace Property
DALI_PROPERTY( "siblingOrder", INTEGER, true, false, false, Dali::DevelActor::Property::SIBLING_ORDER )
DALI_PROPERTY( "updateSizeHint", VECTOR2, true, false, false, Dali::DevelActor::Property::UPDATE_SIZE_HINT )
DALI_PROPERTY( "captureAllTouchAfterStart", BOOLEAN, true, false, false, Dali::DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START )
-DALI_PROPERTY( "touchDelegateArea", VECTOR2, true, false, false, Dali::DevelActor::Property::TOUCH_DELEGATE_AREA )
+DALI_PROPERTY( "touchArea", VECTOR2, true, false, false, Dali::DevelActor::Property::TOUCH_AREA )
DALI_PROPERTY_TABLE_END( DEFAULT_ACTOR_PROPERTY_START_INDEX, ActorDefaultProperties )
// Signals
mTargetPosition( Vector3::ZERO ),
mTargetScale( Vector3::ONE ),
mAnimatedSize( Vector3::ZERO ),
- mTouchDelegateArea( Vector2::ZERO ),
+ mTouchArea( Vector2::ZERO ),
mName(),
mSortedDepth( 0u ),
mDepth( 0u ),
}
/**
- * Sets the touch delegate area of an actor.
+ * Sets the touch area of an actor.
* @param [in] area The new area.
*/
- void SetTouchDelegateArea(Vector2 area)
+ void SetTouchArea(Vector2 area)
{
- mTouchDelegateArea = area;
+ mTouchArea = area;
}
/**
- * Retrieve the Actor's touch delegate area.
- * @return The Actor's touch delegate area.
+ * Retrieve the Actor's touch area.
+ * @return The Actor's touch area.
*/
- const Vector2& GetTouchDelegateArea() const
+ const Vector2& GetTouchArea() const
{
- return mTouchDelegateArea;
+ return mTouchArea;
}
Vector3 mTargetPosition; ///< Event-side storage for position (not a pointer as most actors will have a position)
Vector3 mTargetScale; ///< Event-side storage for scale
Vector3 mAnimatedSize; ///< Event-side storage for size animation
- Vector2 mTouchDelegateArea; ///< touch delegate area
+ Vector2 mTouchArea; ///< touch area
std::string mName; ///< Name of the actor
uint32_t mSortedDepth; ///< The sorted depth index. A combination of tree traversal and sibling order.
break;
}
- case Dali::DevelActor::Property::TOUCH_DELEGATE_AREA:
+ case Dali::DevelActor::Property::TOUCH_AREA:
{
Vector2 vec2Value;
if( property.Get( vec2Value ) )
{
- actor.SetTouchDelegateArea( vec2Value );
+ actor.SetTouchArea( vec2Value );
}
break;
}
break;
}
- case Dali::DevelActor::Property::TOUCH_DELEGATE_AREA:
+ case Dali::DevelActor::Property::TOUCH_AREA:
{
- value = actor.GetTouchDelegateArea();
+ value = actor.GetTouchArea();
break;
}
// Ray travels distance * rayDirLocal to intersect with plane.
distance = a / b;
- const Vector2& size = actor.GetTouchDelegateArea() == Vector2::ZERO ? Vector2(node.GetSize(EventThreadServices::Get().GetEventBufferIndex())) : actor.GetTouchDelegateArea();
+ const Vector2& size = actor.GetTouchArea() == Vector2::ZERO ? Vector2(node.GetSize(EventThreadServices::Get().GetEventBufferIndex())) : actor.GetTouchArea();
hitPointLocal.x = rayOriginLocal.x + rayDirLocal.x * distance + size.x * 0.5f;
hitPointLocal.y = rayOriginLocal.y + rayDirLocal.y * distance + size.y * 0.5f;