From 39343a7c8e1277f6d835491e459f333c057d70f9 Mon Sep 17 00:00:00 2001 From: deadlord082 <135032460+deadlord082@users.noreply.github.com> Date: Mon, 7 Oct 2024 14:20:16 +0200 Subject: [PATCH] =?UTF-8?q?Update=20BrailleBuffer.js=20with=20=F0=9F=98=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BrailleBuffer.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/BrailleBuffer.js b/src/BrailleBuffer.js index 5b09081..831c165 100644 --- a/src/BrailleBuffer.js +++ b/src/BrailleBuffer.js @@ -15,7 +15,7 @@ const stringWidth = require('string-width'); const config = require('./config'); const utils = require('./utils'); - +//😃😃😃😃😃😃😃😃😃😃😃😃😃😃 const asciiMap = { // '▬': [2+32, 4+64], // '¯': [1+16], @@ -28,7 +28,7 @@ const asciiMap = { '█': [255], }; const termReset = '\x1B[39;49m'; - +//😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃 class BrailleBuffer { constructor(width, height) { this.brailleMap = [[0x1, 0x8],[0x2, 0x10],[0x4, 0x20],[0x40, 0x80]]; @@ -84,7 +84,7 @@ class BrailleBuffer { this.pixelBuffer[idx] &= ~mask; }); } - +//😃😃😃😃😃😃😃😃😃😃😃 _project(x, y) { return (x>>1) + (this.width>>1)*(y>>2); } @@ -112,7 +112,7 @@ class BrailleBuffer { }); } } - +//😃😃😃😃😃😃😃😃😃😃😃 //TODO Optimize this part var i, k; const results = []; @@ -145,7 +145,7 @@ class BrailleBuffer { return termReset; } } - +//😃😃😃😃😃😃😃😃😃😃😃 frame() { const output = []; let currentColor = null; @@ -189,7 +189,7 @@ class BrailleBuffer { output.push(termReset+config.delimeter); return output.join(''); } - +//😃😃😃😃😃😃😃😃😃😃😃 setChar(char, x, y, color) { if (0 <= x && x < this.width && 0 <= y && y < this.height) { const idx = this._project(x, y); @@ -207,5 +207,5 @@ class BrailleBuffer { } } } - +//😃😃😃😃😃😃😃😃😃😃😃 module.exports = BrailleBuffer;