Fixed subtle shared mutability bug in tracebd.py

In the hack where we wait for multiple updates to fill out a full
braille/dots line we store the current pixels in a temporary array.
Unfortunately, in some cases, this is the array we modify with
updates...

A copy fixes this.
This commit is contained in:
Christopher Haster
2023-10-27 13:51:04 -05:00
parent 46b78de500
commit 3e46139a45
+1 -1
View File
@@ -534,7 +534,7 @@ class Bd:
needed_height = 4 if braille else 2
self.history = getattr(self, 'history', [])
self.history.append(grid)
self.history.append(grid.copy())
if len(self.history)*self.height < needed_height:
# skip for now