[orca/gnome-3-30] Ensure we don't pan beyond the length of the line being displayed



commit 04c3c12c582d6761413a1b43cae8995d28b0ca67
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Tue Nov 20 17:16:23 2018 -0500

    Ensure we don't pan beyond the length of the line being displayed

 src/orca/braille.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/braille.py b/src/orca/braille.py
index a745ab8ea..3534c44a8 100644
--- a/src/orca/braille.py
+++ b/src/orca/braille.py
@@ -1480,7 +1480,13 @@ def panRight(panAmount=0):
     if panAmount == 0:
         panAmount = _displaySize[0]
 
-    viewport[0] += panAmount
+    if len(_lines) > 0:
+        lineNum = viewport[1]
+        newX = viewport[0] + panAmount
+        string, focusOffset, attributeMask, ranges = _lines[lineNum].getLineInfo()
+        if newX < len(string):
+            viewport[0] = newX
+
     return oldX != viewport[0]
 
 def panToOffset(offset):


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