williamngan / pts

A library for visualization and creative-coding
https://ptsjs.org
Apache License 2.0
5.16k stars 182 forks source link

Crisp 1px lines on HiDPI devices. #199

Open ProtonGustave opened 1 year ago

ProtonGustave commented 1 year ago

I'm using PTS for charts. Sometimes 1px crisp line is needed but with current approach of canvas scaling i'm not sure it's possible. Also i've seen this issue in similar libraries and not sure why everybody doing it. In my local fork i just don't scale canvas and also adjusted few properties(space.width, space.height, mouse events, etc) to be multiplied with pixelScale, works perfect, everything is crisp.

williamngan commented 1 year ago

The current approach seem to work well for me in Mac retina screens and mobile (eg, if I check the demo on ptsjs.org homepage on iPhone). Can you describe more about the issue you're having?