mirror of
https://github.com/stronk-dev/SignalRGB_Effects.git
synced 2025-07-04 19:05:09 +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)`);
|
grd.addColorStop(1, `hsla(${h}, ${s}%, ${l}%, 0)`);
|
||||||
|
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
// Rotate Ball around center
|
// Rotate canvas around the ball
|
||||||
ctx.translate(midPoint.x, midPoint.y);
|
ctx.translate(midPoint.x, midPoint.y + distance);
|
||||||
ctx.translate(0, distance);
|
|
||||||
ctx.rotate(0.001 * rotate);
|
ctx.rotate(0.001 * rotate);
|
||||||
ctx.translate(-midPoint.x, -midPoint.y);
|
ctx.translate(-midPoint.x, -midPoint.y - distance);
|
||||||
ctx.translate(0, -distance);
|
|
||||||
// Draw Ball
|
// 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.fillStyle = grd;
|
||||||
ctx.fill();
|
ctx.fill();
|
||||||
ctx.closePath();
|
ctx.closePath();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user