Merge branch 'main' of https://github.com/community-scripts/ProxmoxVED
This commit is contained in:
commit
1c70bdd69a
@ -130,6 +130,8 @@ const Particles: React.FC<ParticlesProps> = ({
|
|||||||
if (!context.current) return;
|
if (!context.current) return;
|
||||||
|
|
||||||
const maxDistance = 120;
|
const maxDistance = 120;
|
||||||
|
const ctx = context.current; // Store reference to avoid null checks repeatedly
|
||||||
|
|
||||||
circles.current.forEach((p1, i) => {
|
circles.current.forEach((p1, i) => {
|
||||||
for (let j = i + 1; j < circles.current.length; j++) {
|
for (let j = i + 1; j < circles.current.length; j++) {
|
||||||
const p2 = circles.current[j];
|
const p2 = circles.current[j];
|
||||||
@ -139,13 +141,13 @@ const Particles: React.FC<ParticlesProps> = ({
|
|||||||
|
|
||||||
if (distance < maxDistance) {
|
if (distance < maxDistance) {
|
||||||
const opacity = 1 - distance / maxDistance;
|
const opacity = 1 - distance / maxDistance;
|
||||||
context.current.strokeStyle = `rgba(255, 0, 255, ${opacity * 0.8})`;
|
ctx.strokeStyle = `rgba(255, 0, 255, ${opacity * 0.8})`;
|
||||||
context.current.lineWidth = 0.6;
|
ctx.lineWidth = 0.6;
|
||||||
|
|
||||||
context.current.beginPath();
|
ctx.beginPath();
|
||||||
context.current.moveTo(p1.x, p1.y);
|
ctx.moveTo(p1.x, p1.y);
|
||||||
context.current.lineTo(p2.x, p2.y);
|
ctx.lineTo(p2.x, p2.y);
|
||||||
context.current.stroke();
|
ctx.stroke();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user