diff --git a/Common/UI/Context.cpp b/Common/UI/Context.cpp index 118d1ac1bc..a9c2169780 100644 --- a/Common/UI/Context.cpp +++ b/Common/UI/Context.cpp @@ -354,7 +354,9 @@ float UIContext::CalculateTextScale(std::string_view str, float availWidth) cons MeasureTextRect(theme->uiFont, 1.0f, 1.0f, str, availWidth, &actualWidth, &actualHeight, ALIGN_VCENTER); if (actualWidth > availWidth) { // TODO: Return feedback that wrapping was needed. - return std::max(MIN_TEXT_SCALE, availWidth / actualWidth); + // Shave off a little, since float rounding can otherwise leave the scaled text a hair + // wider than availWidth, and then it gets wrapped anyway. + return std::max(MIN_TEXT_SCALE, availWidth / actualWidth * 0.999f); } return 1.0f; }