make canvas2bytes more readable

This commit is contained in:
Shuanglei Tao
2024-12-09 22:07:05 +08:00
parent 110be06089
commit b20a4e8e03
2 changed files with 19 additions and 19 deletions

View File

@@ -205,7 +205,7 @@ function updateImageData(canvas) {
document.getElementById('cmdIMAGE').value = bytesToHex(canvas2bytes(canvas, 'bw'));
if (epdDriver === '03') {
if (dithering.startsWith('bwr')) {
document.getElementById('cmdIMAGE').value += bytesToHex(canvas2bytes(canvas, 'bwr'));
document.getElementById('cmdIMAGE').value += bytesToHex(canvas2bytes(canvas, 'red'));
} else {
const count = document.getElementById('cmdIMAGE').value.length;
document.getElementById('cmdIMAGE').value += 'F'.repeat(count);