From 7df8090a5ddd286e8a554822f613f3e7b26794dd Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Sun, 26 May 2024 15:09:02 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20don=C2=B4t=20make=20PG/CPU=20usage=20go?= =?UTF-8?q?=20over=20100%=20(#140)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ShipFit/Usage.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/ShipFit/Usage.tsx b/src/components/ShipFit/Usage.tsx index d44c27b..a25c79d 100644 --- a/src/components/ShipFit/Usage.tsx +++ b/src/components/ShipFit/Usage.tsx @@ -48,6 +48,9 @@ export const Usage = (props: { break; } + /* Don't try to draw more than 100%. */ + if (usageUsed > usageTotal) usageUsed = usageTotal; + const radius = 232; const degrees = props.angle; const usageDegrees = (degrees * usageUsed) / usageTotal;