mirror of
https://github.com/stronk-dev/SignalRGB_Effects.git
synced 2025-07-04 11:05:08 +02:00
Fix ball sizing
This commit is contained in:
parent
80dfd671f6
commit
02f6c978b1
@ -98,14 +98,12 @@
|
||||
grd.addColorStop(1, `hsla(${h}, ${s}%, ${l}%, 0)`);
|
||||
|
||||
ctx.beginPath();
|
||||
// Rotate Ball around center
|
||||
ctx.translate(midPoint.x, midPoint.y);
|
||||
ctx.translate(0, distance);
|
||||
// Rotate canvas around the ball
|
||||
ctx.translate(midPoint.x, midPoint.y + distance);
|
||||
ctx.rotate(0.001 * rotate);
|
||||
ctx.translate(-midPoint.x, -midPoint.y);
|
||||
ctx.translate(0, -distance);
|
||||
ctx.translate(-midPoint.x, -midPoint.y - distance);
|
||||
// Draw Ball
|
||||
ctx.arc(midPoint.x, midPoint.y, midPoint.x - 2, 0, Math.PI * 2, false);
|
||||
ctx.arc(midPoint.x, midPoint.y, radius, 0, Math.PI * 2, false);
|
||||
ctx.fillStyle = grd;
|
||||
ctx.fill();
|
||||
ctx.closePath();
|
||||
@ -113,4 +111,4 @@
|
||||
window.requestAnimationFrame(update);
|
||||
}
|
||||
window.requestAnimationFrame(update);
|
||||
</script>
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user