From e480f21b288c7b0a9fec32243bdf16e729b4e94f Mon Sep 17 00:00:00 2001 From: stweedo <108593831+stweedo@users.noreply.github.com> Date: Sun, 4 Jun 2023 02:17:10 -0500 Subject: [PATCH] Update app.js - Remove unnecessary variable --- apps/ohmcalc/app.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/ohmcalc/app.js b/apps/ohmcalc/app.js index 600c12431..aa470401c 100644 --- a/apps/ohmcalc/app.js +++ b/apps/ohmcalc/app.js @@ -315,11 +315,10 @@ function calculateValue(calculatedVariable, variableValues) { let valueY = titleY + g.getFontHeight(); // Draw below the title // Calculate the font size for value dynamically - let valueFontSize = fontSize; // Initialize with maximum possible font size - g.setFontVector(valueFontSize); + g.setFontVector(fontSize); while (g.stringWidth(resultValue) > g.getWidth() - 10) { - valueFontSize--; // Reduce the font size by 1 - g.setFontVector(valueFontSize); + fontSize--; // Reduce the font size by 1 + g.setFontVector(fontSize); } valueY += g.getFontHeight() / 2 + 2;