From 339df8768dcb1645c427fc35263b6f0d5a6b0a6c Mon Sep 17 00:00:00 2001 From: Devesh Kaushik <30469038+deveshkau@users.noreply.github.com> Date: Wed, 11 Sep 2019 20:48:44 +0530 Subject: [PATCH 1/2] Updated CONTRIBUTION.md (#1231) * Update Contribution.md As directed by rexagod * Update Contribution.md added libxext-dev * Update CONTRIBUTING.md Co-Authored-By: Harsh Khandeparkar <34770591+HarshKhandeparkar@users.noreply.github.com> --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 90ebf2d5..02a75cd6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,7 +5,7 @@ Happily accepting pull requests; to edit the core library, modify files in `./sr On ARM based devices, the `gl` module may require some libraries to be re-installed: -`sudo apt-get install -y build-essential libxi-dev libglu1-mesa-dev libglew-dev pkg-config` -- see https://github.com/stackgl/headless-gl#ubuntudebian for more. +`sudo apt-get install -y build-essential xserver-xorg-dev libxext-dev libxi-dev libglu1-mesa-dev libglew-dev pkg-config` -- see https://github.com/stackgl/headless-gl#ubuntudebian for more. Most contribution (we imagine) would be in the form of API-compatible modules, which need not be directly included. From d782c147c5c11379f0c40a242c742bc13358fae3 Mon Sep 17 00:00:00 2001 From: keshav234156 <45951376+keshav234156@users.noreply.github.com> Date: Thu, 12 Sep 2019 00:58:02 +0530 Subject: [PATCH 2/2] fixes add-QR and color-picker in draw-rectangle,grid-overlay (#1250) --- src/modules/AddQR/QR.js | 2 +- src/modules/DrawRectangle/DrawRectangle.js | 2 +- src/modules/GridOverlay/GridOverlay.js | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/modules/AddQR/QR.js b/src/modules/AddQR/QR.js index 72de51ec..b23e3ef7 100644 --- a/src/modules/AddQR/QR.js +++ b/src/modules/AddQR/QR.js @@ -32,7 +32,7 @@ module.exports = exports = function (options, pixels, oldPixels, callback) { } else { - pixelSetter(m, n, [qrPixels.get(m, n, 0), qrPixels.get(m, n, 1), qrPixels.get(m, n, 2), qrPixels.get(m, n, 3)], pixels); + pixelSetter(m, n, [oldPixels.get(m, n, 0), oldPixels.get(m, n, 1), oldPixels.get(m, n, 2), oldPixels.get(m, n, 3)], pixels); } } diff --git a/src/modules/DrawRectangle/DrawRectangle.js b/src/modules/DrawRectangle/DrawRectangle.js index a38ac4bd..ee9bf114 100644 --- a/src/modules/DrawRectangle/DrawRectangle.js +++ b/src/modules/DrawRectangle/DrawRectangle.js @@ -19,7 +19,7 @@ module.exports = exports = function(pixels, options){ for (var n = startX; n <= endX + thickness; n++){ for (var k = startY; k <= endY + thickness; k++){ - pixelSetter(n, k, color, pixels); //to remove 4th channel - pixels.set(n, k, 3, color[3]); + pixelSetter(n, k, [color[0], color[1], color[2]], pixels); //to remove 4th channel - pixels.set(n, k, 3, color[3]); } } }; diff --git a/src/modules/GridOverlay/GridOverlay.js b/src/modules/GridOverlay/GridOverlay.js index 82f95340..2a28bf8c 100644 --- a/src/modules/GridOverlay/GridOverlay.js +++ b/src/modules/GridOverlay/GridOverlay.js @@ -2,11 +2,11 @@ module.exports = exports = function(pixels, options){ var defaults = require('./../../util/getDefaults.js')(require('./info.json')); const pixelSetter = require('../../util/pixelSetter.js'); - if(Number(options.x)==0){ + if(Number(options.x) == 0){ options.x = 1; - } - if( Number(options.y)==0) { - options.y =1; + } + if( Number(options.y) == 0) { + options.y = 1; } options.x = Math.abs(Number(options.x)) || defaults.x; @@ -17,14 +17,14 @@ module.exports = exports = function(pixels, options){ for(var x = 0; x < pixels.shape[0]; x += options.x){ for(var y = 0 ; y < pixels.shape[1]; y++){ - pixelSetter(x, y, color, pixels); // to remove 4th channel - pixels.set(x, y, 3, color[3]); + pixelSetter(x, y, [color[0], color[1], color[2]], pixels); // to remove 4th channel - pixels.set(x, y, 3, color[3]); } } for(var y = 0; y < pixels.shape[1]; y += options.y){ for(var x = 0 ; x < pixels.shape[0]; x++){ - pixelSetter(x, y, color, pixels); // to remove 4th channel - pixels.set(x, y, 3, color[3]); + pixelSetter(x, y, [color[0], color[1], color[2]], pixels); // to remove 4th channel - pixels.set(x, y, 3, color[3]); } }