mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-04-27 21:01:37 +00:00
Simplify squash ratio computation.
This commit is contained in:
parent
119b28c640
commit
dd775b8497
1 changed files with 1 additions and 10 deletions
|
|
@ -495,16 +495,7 @@ static bool DrawCategories()
|
||||||
for (size_t i = 0; i < g_categoryCount; i++)
|
for (size_t i = 0; i < g_categoryCount; i++)
|
||||||
{
|
{
|
||||||
textSizes[i] = g_dfsogeistdFont->CalcTextSizeA(size, FLT_MAX, 0.0f, GetCategory(i).c_str());
|
textSizes[i] = g_dfsogeistdFont->CalcTextSizeA(size, FLT_MAX, 0.0f, GetCategory(i).c_str());
|
||||||
|
textSquashRatio[i] = std::min(maxTextWidth / textSizes[i].x, 1.0f);
|
||||||
if (textSizes[i].x > maxTextWidth)
|
|
||||||
{
|
|
||||||
textSquashRatio[i] = maxTextWidth / textSizes[i].x;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
textSquashRatio[i] = 1.0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
tabWidthSum += textSizes[i].x * textSquashRatio[i];
|
tabWidthSum += textSizes[i].x * textSquashRatio[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue