Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes:grid-overlay for negetive input and 0 #1205

Merged
merged 4 commits into from
Aug 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/modules/GridOverlay/GridOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@ module.exports = exports = function(pixels, options){
var defaults = require('./../../util/getDefaults.js')(require('./info.json'));
const pixelSetter = require('../../util/pixelSetter.js');

options.x = Number(options.x) || defaults.x;
options.y = Number(options.y) || defaults.y;
if(Number(options.x)==0){
options.x = 1;
}
if( Number(options.y)==0) {
options.y =1;
}

options.x = Math.abs(Number(options.x)) || defaults.x;
options.y = Math.abs(Number(options.y)) || defaults.y;
color = options.color || defaults.color;
color = color.substring(color.indexOf('(') + 1, color.length - 1); // extract only the values from rgba(_,_,_,_)
color = color.split(',');
Expand Down