add line-width parameter

This commit is contained in:
Asif Bacchus 2020-04-10 04:54:26 -06:00
parent 4b4682c277
commit 3a124e6809
1 changed files with 12 additions and 1 deletions

View File

@ -138,7 +138,7 @@ function particles(){
canvasContext.globalAlpha = opacityValue;
canvasContext.strokeStyle = strokeColour;
}
canvasContext.lineWidth = 1;
canvasContext.lineWidth = width;
canvasContext.beginPath();
canvasContext.moveTo(particlesArray[a].x, particlesArray[a].y);
canvasContext.lineTo(particlesArray[b].x, particlesArray[b].y);
@ -201,6 +201,17 @@ function particles(){
console.log("'sizeMultiplier' must be a finite number. Using default of '5'.");
};
if (typeof width == 'undefined'){
width = 1;
}
else if (Number.isInteger(width) && width > 0){
width;
}
else{
width = 1;
console.log("'width' must be an integer number of pixels greater than 0. Using default of '1'.");
};
if (typeof connections == 'undefined'){
connections = true;
}