diff options
author | Paul Gilbert | 2018-11-01 19:43:44 -0700 |
---|---|---|
committer | Paul Gilbert | 2018-12-08 19:05:59 -0800 |
commit | d954f70d499c9cd96b2bedbfbec59bf7ed4f715a (patch) | |
tree | 0ac1b963ad7e925447336791ba9d71bb42aa10bb /engines | |
parent | 4b5db1da07572eca7a69e40e32c4935921908b3c (diff) | |
download | scummvm-rg350-d954f70d499c9cd96b2bedbfbec59bf7ed4f715a.tar.gz scummvm-rg350-d954f70d499c9cd96b2bedbfbec59bf7ed4f715a.tar.bz2 scummvm-rg350-d954f70d499c9cd96b2bedbfbec59bf7ed4f715a.zip |
GLK: Fix having space between prmpt and input text
Diffstat (limited to 'engines')
-rw-r--r-- | engines/gargoyle/fonts.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/engines/gargoyle/fonts.cpp b/engines/gargoyle/fonts.cpp index e523ecb83d..8172c78d68 100644 --- a/engines/gargoyle/fonts.cpp +++ b/engines/gargoyle/fonts.cpp @@ -104,7 +104,9 @@ int Fonts::drawString(const Point &pos, int fontIdx, const byte *rgb, const Comm Graphics::Font *font = _fontTable[fontIdx]; const uint32 color = _surface->format.RGBToColor(rgb[0], rgb[1], rgb[2]); font->drawString(_surface, text, pt.x, pt.y, _surface->w - pt.x, color); - return font->getBoundingBox(text, pt.x, pt.y, _surface->w - pt.x).right; + + pt.x += font->getStringWidth(text); + return MIN((int)pt.x, (int)_surface->w) * GLI_SUBPIX; } int Fonts::drawStringUni(const Point &pos, int fontIdx, const byte *rgb, const Common::U32String &text, int spw) { @@ -113,7 +115,8 @@ int Fonts::drawStringUni(const Point &pos, int fontIdx, const byte *rgb, const C const uint32 color = _surface->format.RGBToColor(rgb[0], rgb[1], rgb[2]); font->drawString(_surface, text, pt.x, pt.y, _surface->w - pt.x, color); - return font->getBoundingBox(text, pt.x, pt.y, _surface->w - pt.x).right * GLI_SUBPIX; + pt.x += font->getStringWidth(text); + return MIN((int)pt.x, (int)_surface->w) * GLI_SUBPIX; } size_t Fonts::stringWidth(int fontIdx, const Common::String &text, int spw) { |