VirtualBox

Changeset 104158 in vbox for trunk


Ignore:
Timestamp:
Apr 4, 2024 3:09:29 PM (10 months ago)
Author:
vboxsync
Message:

FE/Qt: UICommon: Round font down-scaling up cause there can be too small values otherwise.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp

    r103988 r104158  
    27972797    QFont appFont = qApp->font();
    27982798
     2799    /* Let's round up some double var: */
     2800    auto roundUp = [](double dValue)
     2801    {
     2802        const int iValue = dValue;
     2803        return dValue > (double)iValue ? iValue + 1 : iValue;
     2804    };
     2805
     2806    /* Do we have pixel font? */
    27992807    if (iOriginalFontPixelSize != -1)
    2800         appFont.setPixelSize(iFontScaleFactor / 100.f * iOriginalFontPixelSize);
     2808        appFont.setPixelSize(roundUp(iFontScaleFactor / 100.f * iOriginalFontPixelSize));
     2809    /* Point font otherwise: */
    28012810    else
    2802         appFont.setPointSize(iFontScaleFactor / 100.f * iOriginalFontPointSize);
     2811        appFont.setPointSize(roundUp(iFontScaleFactor / 100.f * iOriginalFontPointSize));
     2812
    28032813    qApp->setFont(appFont);
    28042814}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette