node-pureimage icon indicating copy to clipboard operation
node-pureimage copied to clipboard

lineTo stops without success or error

Open kekscom opened this issue 1 year ago • 0 comments

Expected Behaviour

  1. Polyline is drawn or error thrown.

Actual Behaviour

  1. Pureimage jst stops without feedback.

Steps To Reproduce

  1. 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.

kekscom avatar Mar 27 '24 11:03 kekscom