[orca] Access object extents as a bounding box
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Access object extents as a bounding box
- Date: Wed, 4 Jul 2012 16:12:00 +0000 (UTC)
commit 0deeaa8e019a1568d331bb44f7f812f95d680e34
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 aad5e2b..d1db6e3 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -1506,16 +1506,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]