node-pureimage
node-pureimage copied to clipboard
lineTo stops without success or error
Expected Behaviour
- Polyline is drawn or error thrown.
Actual Behaviour
- Pureimage jst stops without feedback.
Steps To Reproduce
- Run the code below. Works with lineWidth 1 or when skipping the last point.
Any Relevant Code Snippets
const img = PImage.make(128, 128);
const ctx = img.getContext('2d');
ctx.lineWidth = 4; // works with 1
ctx.strokeStyle = '#ffffff';
ctx.beginPath();
const line = [
[90.00, 91],
[92.25, 91],
[92.25, 90],
[90.00, 90],
[92.00, 90] // works without this
];
ctx.moveTo(line[0][0], line[0][1]);
for (let i = 1; i < line.length; i++) {
ctx.lineTo(line[i][0], line[i][1]);
}
ctx.stroke();
Platform
OS: MacOS, Ubuntu Node Version: 20.11.0 NPM Version: 10.5.0 PureImage Version: 0.4.13
Any Additional Info
It would be great when at least an error was thrown so I could skip the critical polyline. I'd be willing to sponsor a bugfix.