From b5ad702c3abafec44fc5b2c9d15b91272751fb29 Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Mon, 13 May 2024 18:13:45 +0100 Subject: [PATCH] promenu: simplify if-else --- apps/promenu/bootb2.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/promenu/bootb2.ts b/apps/promenu/bootb2.ts index ca5a094d9..19f685549 100644 --- a/apps/promenu/bootb2.ts +++ b/apps/promenu/bootb2.ts @@ -87,12 +87,10 @@ type ActualMenuItem = Exclude; /*???*/{ if(name.length >= 17 - v.length && typeof item === "object"){ g.drawString(name.substring(0, 12 - v.length) + "...", x + 3.7, iy + 2.7); + }else if(name.length >= 15){ + g.drawString(name.substring(0, 15) + "...", x + 3.7, iy + 2.7); }else{ - if(name.length >= 15){ - g.drawString(name.substring(0, 15) + "...", x + 3.7, iy + 2.7); - }else{ - g.drawString(name, x + 3.7, iy + 2.7); - } + g.drawString(name, x + 3.7, iy + 2.7); } let xo = x2;