williamngan / pts

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

Radial gradients can't use negative coordinates #195

Closed doseofted closed 1 year ago

doseofted commented 1 year ago

I'm creating an animation with PTS that uses a lot of gradients and noticed an odd behavior when gradients leave the canvas area. It appears that radial gradients can only use absolute coordinates. I've created an example here showing the issue (PTS-related code here) but I'm unsure if this is a bug or a misunderstanding on my part. Is there a better way to use negative coordinates with gradients?

https://user-images.githubusercontent.com/13274728/197338341-4e0baf35-3e3f-4e7a-9635-c9f42b5b1a3b.mov

doseofted commented 1 year ago

I played around with it and may have found a way to use negative coordinates in the linked PR. Let me know if it needs adjustment!

williamngan commented 1 year ago

Hi @doseofted - I'm sorry for the delay on this. Been very busy at work in the past month. Thank you so much for catching this bug and sending a PR too. Really appreciate it 🙏