]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Standardize on camelCase in Decoders
authorSamuel Mannehed <samuel@cendio.se>
Sun, 31 May 2020 21:27:58 +0000 (23:27 +0200)
committerSamuel Mannehed <samuel@cendio.se>
Sun, 31 May 2020 21:37:29 +0000 (23:37 +0200)
core/decoders/hextile.js
core/decoders/raw.js

index b762060d4b17a68d6313ac8b4e24ccbfb441332a..8dbe809222c707d5aac380857ec73f18eedc6a96 100644 (file)
@@ -17,10 +17,10 @@ export default class HextileDecoder {
 
     decodeRect(x, y, width, height, sock, display, depth) {
         if (this._tiles === 0) {
-            this._tiles_x = Math.ceil(width / 16);
-            this._tiles_y = Math.ceil(height / 16);
-            this._total_tiles = this._tiles_x * this._tiles_y;
-            this._tiles = this._total_tiles;
+            this._tilesX = Math.ceil(width / 16);
+            this._tilesY = Math.ceil(height / 16);
+            this._totalTiles = this._tilesX * this._tilesY;
+            this._tiles = this._totalTiles;
         }
 
         while (this._tiles > 0) {
@@ -39,11 +39,11 @@ export default class HextileDecoder {
                             subencoding + ")");
             }
 
-            const curr_tile = this._total_tiles - this._tiles;
-            const tile_x = curr_tile % this._tiles_x;
-            const tile_y = Math.floor(curr_tile / this._tiles_x);
-            const tx = x + tile_x * 16;
-            const ty = y + tile_y * 16;
+            const currTile = this._totalTiles - this._tiles;
+            const tileX = currTile % this._tilesX;
+            const tileY = Math.floor(currTile / this._tilesX);
+            const tx = x + tileX * 16;
+            const ty = y + tileY * 16;
             const tw = Math.min(16, (x + width) - tx);
             const th = Math.min(16, (y + height) - ty);
 
index 0e806d3cc1ee0e5f294369fa56780c5dac8d4de2..4d84d7d105cb737805a55c90570aa718596465c9 100644 (file)
@@ -24,15 +24,15 @@ export default class RawDecoder {
             return false;
         }
 
-        const cur_y = y + (height - this._lines);
-        const curr_height = Math.min(this._lines,
-                                     Math.floor(sock.rQlen / bytesPerLine));
+        const curY = y + (height - this._lines);
+        const currHeight = Math.min(this._lines,
+                                    Math.floor(sock.rQlen / bytesPerLine));
         let data = sock.rQ;
         let index = sock.rQi;
 
         // Convert data if needed
         if (depth == 8) {
-            const pixels = width * curr_height;
+            const pixels = width * currHeight;
             const newdata = new Uint8Array(pixels * 4);
             for (let i = 0; i < pixels; i++) {
                 newdata[i * 4 + 0] = ((data[index + i] >> 0) & 0x3) * 255 / 3;
@@ -44,9 +44,9 @@ export default class RawDecoder {
             index = 0;
         }
 
-        display.blitImage(x, cur_y, width, curr_height, data, index);
-        sock.rQskipBytes(curr_height * bytesPerLine);
-        this._lines -= curr_height;
+        display.blitImage(x, curY, width, currHeight, data, index);
+        sock.rQskipBytes(currHeight * bytesPerLine);
+        this._lines -= currHeight;
         if (this._lines > 0) {
             return false;
         }