Update app.js - Minor font sizing changes
parent
bbbd200e2f
commit
3871197554
|
|
@ -256,7 +256,7 @@ function calculateValue(calculatedVariable, variableValues) {
|
||||||
g.setFontVector(fontSize);
|
g.setFontVector(fontSize);
|
||||||
|
|
||||||
// Reduce the font size until both the value and unit fit on the screen
|
// Reduce the font size until both the value and unit fit on the screen
|
||||||
while (g.stringWidth(result.value) > g.getWidth() - 20 || g.getFontHeight() > g.getHeight() / 2) {
|
while (g.stringWidth(result.value) > g.getWidth() - 10 || g.getFontHeight() > g.getHeight() / 2) {
|
||||||
fontSize--;
|
fontSize--;
|
||||||
g.setFontVector(fontSize);
|
g.setFontVector(fontSize);
|
||||||
}
|
}
|
||||||
|
|
@ -317,8 +317,8 @@ function calculateValue(calculatedVariable, variableValues) {
|
||||||
// Calculate the font size for value dynamically
|
// Calculate the font size for value dynamically
|
||||||
let valueFontSize = fontSize; // Initialize with maximum possible font size
|
let valueFontSize = fontSize; // Initialize with maximum possible font size
|
||||||
g.setFontVector(valueFontSize);
|
g.setFontVector(valueFontSize);
|
||||||
while (g.stringWidth(resultValue) > g.getWidth() && valueFontSize > 1) {
|
while (g.stringWidth(resultValue) > g.getWidth() - 10) {
|
||||||
valueFontSize *= 0.9; // Reduce the font size by 10%
|
valueFontSize--; // Reduce the font size by 1
|
||||||
g.setFontVector(valueFontSize);
|
g.setFontVector(valueFontSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue