OSDN Git Service

When using a contracted braille table and expand to computer braille for the word...
authorJames Teh <jamie@jantrid.net>
Thu, 31 Jan 2013 23:48:01 +0000 (09:48 +1000)
committerJames Teh <jamie@jantrid.net>
Thu, 31 Jan 2013 23:48:01 +0000 (09:48 +1000)
Specifically, we no longer rely on the output cursorPos provided by liblouis, instead calculating this based on rawToBraillePos, which is usually accurate.
Fixes #2947.

source/braille.py
user_docs/en/changes.t2t

index e9b1560..7c4f080 100644 (file)
@@ -377,9 +377,12 @@ class Region(object):
                        self.brailleCells.append(0)\r
                        self.brailleToRawPos.append(0)\r
                if self.cursorPos is not None:\r
-                       # HACK: Work around a liblouis bug whereby the returned cursor position is not within the braille cells returned.\r
-                       if brailleCursorPos >= len(self.brailleCells):\r
-                               brailleCursorPos = len(self.brailleCells) - 1\r
+                       # HACK: The cursorPos returned by liblouis is notoriously buggy (#2947 among other issues).\r
+                       # rawToBraillePos is usually accurate.\r
+                       try:\r
+                               brailleCursorPos = self.rawToBraillePos[self.cursorPos]\r
+                       except IndexError:\r
+                               pass\r
                else:\r
                        brailleCursorPos = None\r
                self.brailleCursorPos = brailleCursorPos\r
index d7b1c0b..19828dc 100644 (file)
@@ -43,6 +43,7 @@
 - The HumanWare Brailliant BI/B series braille display driver can now be selected when the display is connected via Bluetooth but has never been connected via USB.\r
 - Filtering elements in the Browse Mode Elements list with uppercase filter text now returns case-insensitive results just like lowercase rather than nothing at all. (#2951)\r
 - In Mozilla browsers, browse mode can again be used when Flash content is focused. (#2546)\r
+- When using a contracted braille table and expand to computer braille for the word at the cursor is enabled, the braille cursor is now positioned correctly when located after a word wherein a character is represented by multiple braille cells (e.g. capital sign, letter sign, number sign, etc.). (#2947)\r
 \r
 \r
 == Changes for Developers ==\r