promenu: simplify if-else

master
Rob Pilling 2024-05-13 18:13:45 +01:00
parent 9c6f14a63e
commit b5ad702c3a
1 changed files with 3 additions and 5 deletions

View File

@ -87,12 +87,10 @@ type ActualMenuItem = Exclude<Menu["..."], MenuOptions | undefined>;
/*???*/{ /*???*/{
if(name.length >= 17 - v.length && typeof item === "object"){ if(name.length >= 17 - v.length && typeof item === "object"){
g.drawString(name.substring(0, 12 - v.length) + "...", x + 3.7, iy + 2.7); 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{ }else{
if(name.length >= 15){ g.drawString(name, x + 3.7, iy + 2.7);
g.drawString(name.substring(0, 15) + "...", x + 3.7, iy + 2.7);
}else{
g.drawString(name, x + 3.7, iy + 2.7);
}
} }
let xo = x2; let xo = x2;