Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

🐛 Skip drawing the perimeter when the canvas has no size (#3175)

Luke Vellaa5ebd86387d1
diff --git a/apps/landing/src/components/home/perimeter.tsx b/apps/landing/src/components/home/perimeter.tsx
index 4fca842dd..354605eae 100644
--- a/apps/landing/src/components/home/perimeter.tsx
+++ b/apps/landing/src/components/home/perimeter.tsx
@@ -93,6 +93,11 @@ export function Perimeter({ className }: { className?: string }) {
};
const draw = (now: number, dt: number, animate: boolean) => {
+ // A hidden canvas measures 0x0, which would make the grid step 0 and
+ // the loops below never terminate.
+ if (width <= 0 || height <= 0) {
+ return;
+ }
const radius = height / 2;
const cx = width / 2;
const cy = height / 2;