airbnb / lottie-web

Render After Effects animations natively on Web, Android and iOS, and React Native. http://airbnb.io/lottie/
MIT License
30.42k stars 2.86k forks source link

Fix blurry CVImageElement drawing on high dpi (>1.0) displays #2896

Open richardhenry opened 1 year ago

richardhenry commented 1 year ago

The canvas renderer CVImageElement draws blurry images on high dpi displays, like this example where the dpi is 2.0:

Screenshot 2022-12-21 at 6 41 08 PM

This diff changes the implementation so that images draw correctly:

Screenshot 2022-12-21 at 6 43 27 PM

I'm not sure if this is the optimal fix, but it seems to work.

bodymovin commented 1 year ago

hey thanks for the PR! If I understand it correctly, you're drawing the img directly to the canvas and dropping the buffer canvas, is that right?
(btw, can you update the PR without building the files?)