[ATSPI] Add CalculateScreenExtents function
[platform/core/uifw/dali-core.git] / dali / internal / event / actors / actor-impl.cpp
index f4590fc..876182f 100644 (file)
@@ -1314,6 +1314,9 @@ void Actor::SetSizeScalePolicy( SizeScalePolicy::Type policy )
   EnsureRelayoutData();
 
   mRelayoutData->sizeSetPolicy = policy;
+
+  // Trigger relayout on this control
+  RelayoutRequest();
 }
 
 SizeScalePolicy::Type Actor::GetSizeScalePolicy() const
@@ -3469,6 +3472,15 @@ bool Actor::DoAction( BaseObject* object, const std::string& actionName, const P
   return done;
 }
 
+Rect<> Actor::CalculateScreenExtents( ) const
+{
+  auto screenPosition = GetCurrentScreenPosition();
+  Vector3 size = GetCurrentSize() * GetCurrentWorldScale();
+  Vector3 anchorPointOffSet = size * ( mPositionUsesAnchorPoint ? GetCurrentAnchorPoint() : AnchorPoint::TOP_LEFT );
+  Vector2 position = Vector2( screenPosition.x - anchorPointOffSet.x, screenPosition.y - anchorPointOffSet.y );
+  return { position.x, position.y, size.x, size.y };
+}
+
 bool Actor::GetCachedPropertyValue( Property::Index index, Property::Value& value ) const
 {
   bool valueSet = true;