diff --git a/src/emucore/FBSurface.cxx b/src/emucore/FBSurface.cxx index 4b882346f..c489fc703 100644 --- a/src/emucore/FBSurface.cxx +++ b/src/emucore/FBSurface.cxx @@ -329,7 +329,7 @@ bool FBSurface::isWhiteSpace(const char s) const int FBSurface::drawString(const GUI::Font& font, const string& s, int x, int y, int w, int h, ColorId color, TextAlign align, - bool useEllipsis, ColorId shadowColor) + int deltax, bool useEllipsis, ColorId shadowColor) { int lines = 1; @@ -355,13 +355,13 @@ int FBSurface::drawString(const GUI::Font& font, const string& s, //str += inStr[i]; } wrapString(inStr, i, leftStr, rightStr); - drawString(font, leftStr, x, y, w, color, align, false, shadowColor); + drawString(font, leftStr, x, y, w, color, align, deltax, false, shadowColor); h -= font.getFontHeight(); y += font.getFontHeight(); inStr = rightStr; lines++; } - drawString(font, inStr, x, y, w, color, align, useEllipsis, shadowColor); + drawString(font, inStr, x, y, w, color, align, deltax, useEllipsis, shadowColor); #endif return lines; } @@ -370,7 +370,7 @@ int FBSurface::drawString(const GUI::Font& font, const string& s, void FBSurface::drawString(const GUI::Font& font, const string& s, int x, int y, int w, ColorId color, TextAlign align, - bool useEllipsis, ColorId shadowColor) + int deltax, bool useEllipsis, ColorId shadowColor) { #ifdef GUI_SUPPORT const string ELLIPSIS = "\x1d"; // "..." @@ -410,6 +410,7 @@ void FBSurface::drawString(const GUI::Font& font, const string& s, else if(align == TextAlign::Right) x = x + w - width; + x += deltax; for(i = 0; i < str.size(); ++i) { w = font.getCharWidth(str[i]); diff --git a/src/emucore/FBSurface.hxx b/src/emucore/FBSurface.hxx index 4be99dc42..48632404d 100644 --- a/src/emucore/FBSurface.hxx +++ b/src/emucore/FBSurface.hxx @@ -218,6 +218,7 @@ class FBSurface @param h The height of the string area (for multi line strings) @param color The color of the text @param align The alignment of the text in the string width area + @param deltax FIXME @param useEllipsis Whether to use '...' when the string is too long @return Number of lines drawn */ @@ -225,7 +226,7 @@ class FBSurface virtual int drawString( const GUI::Font& font, const string& s, int x, int y, int w, int h, ColorId color, TextAlign align = TextAlign::Left, - bool useEllipsis = true, ColorId shadowColor = kNone); + int deltax = 0, bool useEllipsis = true, ColorId shadowColor = kNone); /** This method should be called to draw the specified string. @@ -237,12 +238,13 @@ class FBSurface @param w The width of the string area @param color The color of the text @param align The alignment of the text in the string width area + @param deltax FIXME @param useEllipsis Whether to use '...' when the string is too long */ virtual void drawString( const GUI::Font& font, const string& s, int x, int y, int w, ColorId color, TextAlign align = TextAlign::Left, - bool useEllipsis = true, ColorId shadowColor = kNone); + int deltax = 0, bool useEllipsis = true, ColorId shadowColor = kNone); ////////////////////////////////////////////////////////////////////////// // Note: The following methods are FBSurface-specific, and must be diff --git a/src/emucore/FrameBuffer.cxx b/src/emucore/FrameBuffer.cxx index 2a53d2c8f..97af29fcf 100644 --- a/src/emucore/FrameBuffer.cxx +++ b/src/emucore/FrameBuffer.cxx @@ -600,7 +600,7 @@ void FrameBuffer::drawFrameStats(float framesPerSecond) << info.DisplayFormat; myStatsMsg.surface->drawString(f, ss.str(), xPos, yPos, - myStatsMsg.w, color, TextAlign::Left, true, kBGColor); + myStatsMsg.w, color, TextAlign::Left, 0, true, kBGColor); yPos += dy; ss.str(""); @@ -615,7 +615,7 @@ void FrameBuffer::drawFrameStats(float framesPerSecond) << "% speed"; myStatsMsg.surface->drawString(f, ss.str(), xPos, yPos, - myStatsMsg.w, myStatsMsg.color, TextAlign::Left, true, kBGColor); + myStatsMsg.w, myStatsMsg.color, TextAlign::Left, 0, true, kBGColor); yPos += dy; ss.str(""); @@ -624,7 +624,7 @@ void FrameBuffer::drawFrameStats(float framesPerSecond) if (myOSystem.settings().getBool("dev.settings")) ss << "| Developer"; myStatsMsg.surface->drawString(f, ss.str(), xPos, yPos, - myStatsMsg.w, myStatsMsg.color, TextAlign::Left, true, kBGColor); + myStatsMsg.w, myStatsMsg.color, TextAlign::Left, 0, true, kBGColor); myStatsMsg.surface->setDstPos(myImageRect.x() + 10, myImageRect.y() + 8); myStatsMsg.surface->setDstSize(myStatsMsg.w * hidpiScaleFactor(), diff --git a/src/gui/Widget.cxx b/src/gui/Widget.cxx index 132bbd7b9..ed6ba2f02 100644 --- a/src/gui/Widget.cxx +++ b/src/gui/Widget.cxx @@ -344,7 +344,7 @@ void StaticTextWidget::drawWidget(bool hilite) FBSurface& s = _boss->dialog().surface(); bool onTop = _boss->dialog().isOnTop(); s.drawString(_font, _label, _x, _y, _w, - isEnabled() && onTop ? _textcolor : kColor, _align, true, _shadowcolor); + isEnabled() && onTop ? _textcolor : kColor, _align, 0, true, _shadowcolor); setDirty(); }