-
-
Notifications
You must be signed in to change notification settings - Fork 654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix EcoBraille and Lilly braille display drivers #17635
Conversation
See test results for failed build of commit a1fe5402ce |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, @LeonarddeR. Just a docstring change while you're here. Plus we need to wait on real world testing.
I asked an additional review from @michaelDCurran since this touches his code. I'd like to make sure that he agrees with changing the initial state of |
Co-authored-by: Sascha Cowley <[email protected]>
See test results for failed build of commit 35b44e5aec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks fine to me. I've also tested with both a single line and multiline display.
I wonder why the tests fail here. Will investigate |
I discovered that the system tests were still using the old |
See test results for failed build of commit 705cfc1636 |
It looks like initializing |
See test results for failed build of commit 64cc17c2b9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @LeonarddeR
Fixes nvaccess#17502 Summary of the issue: In nvaccess#15386, support was added for numRows and numCols on braille displays. Setting numCells explicitly would also set numCols. In nvaccess#17011, we're much more relying on numCols and numRows. For the eco braille and Lilli drivers, numCells was implemented by overriding _get_numCells. However this way, the setter of numCells would never be called and therefore numCols would always be 0. Description of user facing changes Fix braille for Eco Braille and Lilli displays. Description of development approach When calculating display dimensions on the braille handler, when display.numRows is 1, use display.numCells instead of display.numCols. This accounts for cases where numCells is implemented and numRows/numCols are not. Worked around the ZeroDevisionError when getting windowStartPost on a buffer Initialize _windowRowBufferOffsets to [(0, 0)] instead of [(0, 1)]. The latter suggests that the window contains one cell, which is not the case. @michaelDCurran you might want to check this.
Link to issue number:
Fixes #17502
Summary of the issue:
In #15386, support was added for numRows and numCols on braille displays. Setting numCells explicitly would also set numCols.
In #17011, we're much more relying on numCols and numRows.
For the eco braille and Lilli drivers, numCells was implemented by overriding _get_numCells. However this way, the setter of numCells would never be called and therefore numCols would always be 0.
Description of user facing changes
Fix braille for Eco Braille and Lilli displays.
Description of development approach
[(0, 0)]
instead of[(0, 1)]
. The latter suggests that the window contains one cell, which is not the case. @michaelDCurran you might want to check this.Testing strategy:
@dreinn Could you test this?
Known issues with pull request:
I think we should consider a long term strategy for
numCells
vs.numRows
/numCols
. We still need to account for both now, which isn't ideal and could easily go wrong as proved.Code Review Checklist:
@coderabbitai summary