Ticket #8388: scaleableGui-v3.patch

File scaleableGui-v3.patch, 731 bytes (added by lordhoto, 20 years ago)

patch on top of 'scaleableGui-v2.patch'

  • gui/newgui.cpp

    diff -u --rec -N --exclude=CVS --exclude=.deps --exclude=*.o scummvm.old/gui/newgui.cpp scummvm/gui/newgui.cpp
    old new  
    358358}
    359359
    360360int NewGui::getStringWidth(const String &str) {
    361         int width = 0;
    362         for (uint p = 0; p < str.size(); p++)
    363                 width += getCharWidth(str[p]);
    364         return width;
     361        return getFont().getStringWidth(str);
    365362}
    366363
    367364int NewGui::getCharWidth(byte c) {
    368         return getFont().getCharWidth(c) * c != ' ' ? _scaleFactorWidth : 1;
     365        return getFont().getCharWidth(c);
    369366}
    370367
    371368void NewGui::drawString(const String &s, int x, int y, int w, OverlayColor color, TextAlignment align, int deltax, bool useEllipsis) {