[orca] Ensure we don't pan beyond the length of the line being displayed
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Ensure we don't pan beyond the length of the line being displayed
- Date: Tue, 20 Nov 2018 22:17:08 +0000 (UTC)
commit c4d7f12161567893e8793c2fad956cb736739cb0
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]