Skip to content

Commit 9b4a58c

Browse files
committed
httpmsg screen drawing, use new ClearDontDraw
1 parent 7f77435 commit 9b4a58c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/services/httpmsg/html.toit

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,7 @@ generate-screen-html -> string:
329329
pixels: (endRow - startRow + 1) * gridWidth,
330330
cArrayOutput: cArray.join(','),
331331
}
332-
const isLastRow = endRow === gridHeight - 1;
333-
box.msgBytes = box2msgb(box, pageId, isLastRow);
332+
box.msgBytes = box2msgb(box, pageId, (startRow === 0), (endRow === gridHeight - 1));
334333
exportBoxes.push(box);
335334
startRow = endRow + 1;
336335
}
@@ -359,7 +358,7 @@ generate-screen-html -> string:
359358
submitMulti(toSend);
360359
}
361360
362-
function box2msgb(box, pageId, isLastMsg= true) {
361+
function box2msgb(box, pageId, isFirst=true, isLast=true) {
363362
const ui16le = (num) => {
364363
return [num & 0xff, (num >> 8) & 0xff];
365364
};
@@ -377,7 +376,9 @@ generate-screen-html -> string:
377376
d.set(9, [box.exportSizeX]);
378377
d.set(10, [box.exportSizeY]);
379378
d.set(25, box.cArrayOutput.split(',').map(byte => parseInt(byte, 16)));
380-
if(isLastMsg) {
379+
if(isFirst) {
380+
d.set(6, [5]); // ClearDontDraw
381+
} else if(isLast) {
381382
d.set(6, [4]); // FullRedrawWithoutClear
382383
} else {
383384
d.set(6, [3]); // BufferOnly

0 commit comments

Comments
 (0)