Remove superfluous 'deltax' parameter in drawString; I have no idea what it was doing there.

This commit is contained in:
Stephen Anthony 2020-06-19 20:02:00 -02:30
parent eafa29a520
commit 6a180aeda0
4 changed files with 10 additions and 13 deletions

View File

@ -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,
int deltax, bool useEllipsis, ColorId shadowColor)
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, deltax, false, shadowColor);
drawString(font, leftStr, x, y, w, color, align, false, shadowColor);
h -= font.getFontHeight();
y += font.getFontHeight();
inStr = rightStr;
lines++;
}
drawString(font, inStr, x, y, w, color, align, deltax, useEllipsis, shadowColor);
drawString(font, inStr, x, y, w, color, align, 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,
int deltax, bool useEllipsis, ColorId shadowColor)
bool useEllipsis, ColorId shadowColor)
{
#ifdef GUI_SUPPORT
const string ELLIPSIS = "\x1d"; // "..."
@ -410,7 +410,6 @@ 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]);

View File

@ -218,7 +218,6 @@ 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
*/
@ -226,7 +225,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,
int deltax = 0, bool useEllipsis = true, ColorId shadowColor = kNone);
bool useEllipsis = true, ColorId shadowColor = kNone);
/**
This method should be called to draw the specified string.
@ -238,13 +237,12 @@ 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,
int deltax = 0, bool useEllipsis = true, ColorId shadowColor = kNone);
bool useEllipsis = true, ColorId shadowColor = kNone);
//////////////////////////////////////////////////////////////////////////
// Note: The following methods are FBSurface-specific, and must be

View File

@ -600,7 +600,7 @@ void FrameBuffer::drawFrameStats(float framesPerSecond)
<< info.DisplayFormat;
myStatsMsg.surface->drawString(f, ss.str(), xPos, yPos,
myStatsMsg.w, color, TextAlign::Left, 0, true, kBGColor);
myStatsMsg.w, color, TextAlign::Left, 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, 0, true, kBGColor);
myStatsMsg.w, myStatsMsg.color, TextAlign::Left, 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, 0, true, kBGColor);
myStatsMsg.w, myStatsMsg.color, TextAlign::Left, true, kBGColor);
myStatsMsg.surface->setDstPos(myImageRect.x() + 10, myImageRect.y() + 8);
myStatsMsg.surface->setDstSize(myStatsMsg.w * hidpiScaleFactor(),

View File

@ -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, 0, true, _shadowcolor);
isEnabled() && onTop ? _textcolor : kColor, _align, true, _shadowcolor);
setDirty();
}