Skip to content

Commit c2536e9

Browse files
committed
screen.ts getBuffer experimentation 1
1 parent 0d4e097 commit c2536e9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

screen.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,18 +148,20 @@ namespace user_interface_base {
148148
return res
149149
}
150150

151-
// Simply get the row, slice off the required bytes:
151+
// Buffer lies on a single row:
152+
// Simply get the row then slice off the required bytes.
152153
else {
153154
const rowBuf = Buffer.create(bitmap.width);
155+
bitmap.getRows(startingRow, rowBuf);
154156
let res = Buffer.create(chunkSize);
155157

156158
// bitmap.getRows(startingRow, rowBuf);
157159
// basic.showNumber(rowBuf.length)
158160
// const res = rowBuf.slice(startIndex % width, chunkSize);
159161
const start = startIndex % width;
160-
const end = start + chunkSize;
162+
// const end = start + chunkSize;
161163
for (let i = 0; i < chunkSize; i++) {
162-
res[i] = rowBuf[i + startIndex];
164+
res[i] = rowBuf[i + start];
163165
}
164166
return res
165167
}

0 commit comments

Comments
 (0)