[ATSPI] Fix for SCREEN coordinate type in GetExtents 65/261965/2
authorLukasz Oleksak <l.oleksak@samsung.com>
Thu, 29 Jul 2021 19:06:58 +0000 (21:06 +0200)
committerArtur Świgoń <a.swigon@samsung.com>
Tue, 3 Aug 2021 16:26:29 +0000 (18:26 +0200)
Change-Id: Iacb43e0ec0799b73a433bc56bf32f4bfccc86255

dali/devel-api/adaptor-framework/accessibility-impl.cpp

index 48b1a10..e7b72cb 100644 (file)
@@ -28,6 +28,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/devel-api/adaptor-framework/accessibility-impl.h>
 
 // INTERNAL INCLUDES
 #include <dali/devel-api/adaptor-framework/accessibility-impl.h>
+#include <dali/devel-api/adaptor-framework/window-devel.h>
 #include <dali/internal/adaptor/common/adaptor-impl.h>
 #include <dali/public-api/dali-adaptor-common.h>
 
 #include <dali/internal/adaptor/common/adaptor-impl.h>
 #include <dali/public-api/dali-adaptor-common.h>
 
@@ -625,7 +626,16 @@ public:
     Vector3     anchorPointOffSet       = size * (positionUsesAnchorPoint ? actor.GetCurrentProperty<Vector3>(Actor::Property::ANCHOR_POINT) : AnchorPoint::TOP_LEFT);
     Vector2     position                = Vector2(screenPosition.x - anchorPointOffSet.x, screenPosition.y - anchorPointOffSet.y);
 
     Vector3     anchorPointOffSet       = size * (positionUsesAnchorPoint ? actor.GetCurrentProperty<Vector3>(Actor::Property::ANCHOR_POINT) : AnchorPoint::TOP_LEFT);
     Vector2     position                = Vector2(screenPosition.x - anchorPointOffSet.x, screenPosition.y - anchorPointOffSet.y);
 
-    return {position.x, position.y, size.x, size.y};
+    if(type == Dali::Accessibility::CoordinateType::WINDOW)
+    {
+      return {position.x, position.y, size.x, size.y};
+    }
+    else // Dali::Accessibility::CoordinateType::SCREEN
+    {
+      auto window = Dali::DevelWindow::Get(actor);
+      auto windowPosition = window.GetPosition();
+      return {position.x + windowPosition.GetX(), position.y + windowPosition.GetY(), size.x, size.y};
+    }
   }
 
   Dali::Accessibility::ComponentLayer GetLayer() override
   }
 
   Dali::Accessibility::ComponentLayer GetLayer() override