[AT-SPI] Fix not working screen reader when rerunning it
[platform/core/uifw/dali-adaptor.git] / dali / internal / accessibility / bridge / component.cpp
index 73334a1..d93789a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
 
 using namespace Dali::Accessibility;
 
-bool Component::Contains( Point p, CoordType ctype )
+bool Component::IsAccessibleContainingPoint(Point point, Dali::Accessibility::CoordinateType type)
 {
-  auto extents = GetExtents( ctype );
-  return p.x >= extents.x && p.y >= extents.y && p.x <= extents.x + extents.width && p.y <= extents.y + extents.height;
+  auto extents = GetExtents(type);
+  return point.x >= extents.x && point.y >= extents.y && point.x <= extents.x + extents.width && point.y <= extents.y + extents.height;
 }
 
-Accessible* Component::GetAccessibleAtPoint( Point p, CoordType ctype )
+Accessible* Component::GetAccessibleAtPoint(Point point, Dali::Accessibility::CoordinateType type)
 {
   auto children = GetChildren();
-  for( auto childIt = children.rbegin(); childIt != children.rend(); childIt++ )
+  for(auto childIt = children.rbegin(); childIt != children.rend(); childIt++)
   {
-    auto component = dynamic_cast< Component* >( *childIt );
-    if( component && component->Contains( p, ctype ) )
+    auto component = dynamic_cast<Component*>(*childIt);
+    if(component && component->IsAccessibleContainingPoint(point, type))
     {
       return component;
     }