diff options
author | Martin Ashby <martin@ashbysoft.com> | 2018-07-03 19:07:13 +0100 |
---|---|---|
committer | Martin Ashby <martin@ashbysoft.com> | 2018-07-03 19:07:13 +0100 |
commit | 62bc310a2639d98df36f193a7dee8cac0dc536b5 (patch) | |
tree | 4aac505002aa7e33b41fed32843e0c116c506736 /src/Utils.js | |
parent | 585ac1563dcc89e1fac4526497c16c0bc7b9858e (diff) | |
download | unicornpaint-62bc310a2639d98df36f193a7dee8cac0dc536b5.tar.gz unicornpaint-62bc310a2639d98df36f193a7dee8cac0dc536b5.tar.bz2 unicornpaint-62bc310a2639d98df36f193a7dee8cac0dc536b5.tar.xz unicornpaint-62bc310a2639d98df36f193a7dee8cac0dc536b5.zip |
Slightly wider color indicator.
Youtube instead of periscope.
Linter complaints resolved.
Quicker deploy script.
Diffstat (limited to 'src/Utils.js')
-rw-r--r-- | src/Utils.js | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/Utils.js b/src/Utils.js index eeeca0d..da4bab0 100644 --- a/src/Utils.js +++ b/src/Utils.js @@ -155,7 +155,7 @@ function transformPixels(pixels, transform) { let width = pixels.length let height = pixels[0].length let newPixels = [] - for (var x = 0; x < width; x++) { + for (let x = 0; x < width; x++) { let column = [] for (var y = 0; y < height; y++) { column.push([0, 0, 0]) @@ -163,8 +163,8 @@ function transformPixels(pixels, transform) { newPixels.push(column) } - for (var x = 0; x < width; x++) { - for (var y = 0; y < height; y++) { + for (let x = 0; x < width; x++) { + for (let y = 0; y < height; y++) { let px = getPixel(x, y, pixels) let {newx, newy} = transform(x, y, width, height) newPixels[newx][newy] = px @@ -191,20 +191,19 @@ function readGifFrames(base64GifData) { // Create the x, y array upfront let pixels = new Array(width) - for (var y=0; y<height; y++) { + for (let y=0; y<height; y++) { pixels[y] = new Array(height) } frames.push(pixels) // Copy pixels to out array. The data provided is provided in rows var ix = 0 - for (var y=0; y<height; y++) { - for (var x=0; x<width; x++) { + for (let y=0; y<height; y++) { + for (let x=0; x<width; x++) { let r = rawPixels[ix++] let g = rawPixels[ix++] let b = rawPixels[ix++] - // let a = rawPixels[ix++] - ix++ // Ignore the alpha component + ix++ // Ignore the alpha component pixels[x][y] = [r, g, b] } } |