image-js / image-js-typescript

Temporary repository to work on the migration of image-js to TypeScript
https://image-js.github.io/image-js-typescript/
MIT License
5 stars 5 forks source link

`drawPoints` does not handle points with floating point values #353

Closed opatiny closed 1 year ago

opatiny commented 1 year ago

I had to draw points for a test case and drawPoints was ignoring some of my points, which seemed like a very unexpected behaviour. I realised that some of the points were not whole values.

We should handle floating point values, either:

@targos, wdyt?

targos commented 1 year ago

Let's Math.round, and do the same in other draw functions. I expect the result to be closer to what we would have with a continuous plane.

opatiny commented 1 year ago

This is actually an issue in many functions, I've just had it in copyToas well.

opatiny commented 1 year ago

This is actually an issue in many functions, I've just had it in copyToas well.

@targos, in the case of copyTo we said that we would like to throw instead of rounding right?

targos commented 1 year ago

Yes

image