mirror of
https://github.com/stronk-dev/SignalRGB_Effects.git
synced 2026-04-20 13:25:10 +02:00
Fix gradientLine.html
bug could cause it to spin EXTREMELY quickly
This commit is contained in:
parent
44aa8a136a
commit
ee9ee66285
@ -73,12 +73,13 @@
|
||||
if (h == -1 || s == -1 || l == -1) {
|
||||
[h, s, l] = hexToHSL(fg);
|
||||
}
|
||||
// Reset canvas
|
||||
// Reset canvas transform and clear
|
||||
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
||||
ctx.fillStyle = bg;
|
||||
ctx.fillRect(0, 0, width, height);
|
||||
|
||||
// Update rotation of line
|
||||
rotate += speed;
|
||||
// Update rotation of line (wrap to avoid precision loss)
|
||||
rotate = (rotate + speed) % 6283.185;
|
||||
|
||||
// Calculate useful anchor points
|
||||
startPoint = {
|
||||
@ -123,4 +124,4 @@
|
||||
window.requestAnimationFrame(update);
|
||||
}
|
||||
window.requestAnimationFrame(update);
|
||||
</script>
|
||||
</script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user