[orca] braille: fix bogus dots appearing after text



commit 1bbccdcf64873b18fec852e421ceb8022315143e
Author: Samuel Thibault <samuel thibault ens-lyon org>
Date:   Thu Apr 5 23:25:07 2018 +0200

    braille: fix bogus dots appearing after text
    
    endPos-startPos may not be as big as the braille output (which is the reason
    for the whilewriteStruct.regionSize < _displaySize[0] loop actually).
    attributeMask was getting grown by the loop, but then still cut to
    endPos-startPos, thus leaving undefined values in the rest of the
    braille output.
    
    This changes the logic to the same as for computing substring: cut the
    piece first, add spaces, and just put the result in the writeStruct.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=795015

 src/orca/braille.py |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/braille.py b/src/orca/braille.py
index 549259b..2974108 100644
--- a/src/orca/braille.py
+++ b/src/orca/braille.py
@@ -1205,6 +1205,10 @@ def refresh(panToCursor=True,
     log.info(logLine)
 
     substring = string[startPos:endPos]
+    if attributeMask:
+        submask = attributeMask[startPos:endPos]
+    else:
+        submask = '\x00' * (endPos - startPos)
     if not _brlAPIRunning:
         init(_callback, settings.tty)
     if _brlAPIRunning:
@@ -1214,7 +1218,7 @@ def refresh(panToCursor=True,
         while writeStruct.regionSize < _displaySize[0]:
             substring += " "
             if attributeMask:
-                attributeMask += '\x00'
+                submask += '\x00'
             writeStruct.regionSize += 1
         writeStruct.text = substring
         writeStruct.cursor = cursorCell
@@ -1235,7 +1239,7 @@ def refresh(panToCursor=True,
         #writeStruct.attrOr = myUnderline
 
         if attributeMask:
-            writeStruct.attrOr = attributeMask[startPos:endPos]
+            writeStruct.attrOr = submask
 
         if not _brlAPIRunning:
             init(_callback, settings.tty)


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