Skip to content

Commit

Permalink
fixes add-QR and color-picker in draw-rectangle,grid-overlay (#1250)
Browse files Browse the repository at this point in the history
  • Loading branch information
keshav234156 authored and jywarren committed Sep 11, 2019
1 parent 339df87 commit d782c14
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/modules/AddQR/QR.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

}
Expand Down
2 changes: 1 addition & 1 deletion src/modules/DrawRectangle/DrawRectangle.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
}
};
Expand Down
12 changes: 6 additions & 6 deletions src/modules/GridOverlay/GridOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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]);

}
}
Expand Down

0 comments on commit d782c14

Please sign in to comment.