[orca/gnome-3-6] Access object extents as a bounding box



commit de0fdfc6e9831aa98a990f17f35887b1b2888d74
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed Jul 4 12:09:47 2012 -0400

    Access object extents as a bounding box

 src/orca/script_utilities.py |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index b3c2e07..0b7a406 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -1503,16 +1503,18 @@ class Utilities:
         place as, or is after obj2."""
 
         try:
-            extents1 = obj1.queryComponent().getExtents(pyatspi.DESKTOP_COORDS)
+            bbox = obj1.queryComponent().getExtents(pyatspi.DESKTOP_COORDS)
+            x1, y1 = bbox.x, bbox.y
         except:
-            extents1 = 0, 0, 0, 0
+            x1, y1 = 0, 0
 
         try:
-            extents2 = obj2.queryComponent().getExtents(pyatspi.DESKTOP_COORDS)
+            bbox = obj2.queryComponent().getExtents(pyatspi.DESKTOP_COORDS)
+            x2, y2 = bbox.x, bbox.y
         except:
-            extents2 = 0, 0, 0, 0
+            x2, y2 = 0, 0
 
-        rv = extents1[1] - extents2[1] or extents1[0] - extents2[0]
+        rv = y1 - y2 or x1 - x2
         rv = max(rv, -1)
         rv = min(rv, 1)
 



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