Skip to content

Commit f54ded0

Browse files
committed
screen.ts getBuffer: trying without getRow fix
1 parent 2ad99d9 commit f54ded0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

screen.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,16 +151,17 @@ namespace user_interface_base {
151151
// Simply get the row, slice off the required bytes:
152152
else {
153153
const rowBuf = Buffer.create(bitmap.width);
154+
let res = Buffer.create(chunkSize);
154155

155156
// bitmap.getRows(startingRow, rowBuf);
156157
// basic.showNumber(rowBuf.length)
157158
// const res = rowBuf.slice(startIndex % width, chunkSize);
158159
const start = startIndex % width;
159160
const end = start + chunkSize;
160161
for (let i = start; i < end; i++) {
161-
rowBuf[i] = 3;
162+
res[i - start] = rowBuf[i];
162163
}
163-
return rowBuf
164+
return res
164165
}
165166
}
166167

0 commit comments

Comments
 (0)