[orca] Fall back on child index when spatially comparing objects with bogus extents



commit 433c49fb3bbb534a760e7d1c4bb8abb2a23892cf
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Sat Sep 14 16:14:55 2013 -0400

    Fall back on child index when spatially comparing objects with bogus extents

 src/orca/script_utilities.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index 96c8ebf..2f7df04 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -1493,6 +1493,14 @@ class Utilities:
             x2, y2 = 0, 0
 
         rv = y1 - y2 or x1 - x2
+
+        # If the objects claim to have the same coordinates, there is either
+        # a horrible design crime or we've been given bogus extents. Fall back
+        # on the index in the parent. This is seen with GtkListBox items which
+        # had been scrolled off-screen.
+        if not rv and obj1.parent == obj2.parent:
+            rv = obj1.getIndexInParent() - obj2.getIndexInParent()
+
         rv = max(rv, -1)
         rv = min(rv, 1)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]