williamngan / pts

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

Removed pt.abs() call from gradient method #196

Closed doseofted closed 1 year ago

doseofted commented 1 year ago

This is an attempt to fix radial gradient behavior for gradients that have a negative center Pt, outside the bounds of the canvas.

This allow gradients to use negative coordinates but enforces an absolute value for the radius as expected by createRadialGradient(...). Note: while it appears to fix my issue, I don't yet know if using pt.abs() may be important for other reasons outside of my use case.

williamngan commented 1 year ago

Thank you so much @doseofted