Simplify squash ratio computation.

This commit is contained in:
Dario 2025-02-11 20:41:22 -03:00
parent 119b28c640
commit dd775b8497

View file

@ -495,16 +495,7 @@ static bool DrawCategories()
for (size_t i = 0; i < g_categoryCount; i++)
{
textSizes[i] = g_dfsogeistdFont->CalcTextSizeA(size, FLT_MAX, 0.0f, GetCategory(i).c_str());
if (textSizes[i].x > maxTextWidth)
{
textSquashRatio[i] = maxTextWidth / textSizes[i].x;
}
else
{
textSquashRatio[i] = 1.0f;
}
textSquashRatio[i] = std::min(maxTextWidth / textSizes[i].x, 1.0f);
tabWidthSum += textSizes[i].x * textSquashRatio[i];
}