GUI: RTL: Fix 1-off issue for drawing u32 strings

When RTL mode is on, previously it was fixed in a commit. This commit just reapplies that, for u32 string drawing.
This commit is contained in:
aryanrawlani28 2020-06-22 20:41:33 +05:30 committed by Eugene Sandulenko
parent 4506bcd9f3
commit 521acaf459

View File

@ -1114,8 +1114,17 @@ drawString(const Graphics::Font *font, const Common::U32String &text, const Comm
drawArea = drawArea.findIntersectingRect(Common::Rect(0, 0, _activeSurface->w, _activeSurface->h));
if (!drawArea.isEmpty()) {
Common::Rect textArea(area);
textArea.right -= deltax;
Surface textAreaSurface = _activeSurface->getSubArea(drawArea);
font->drawString(&textAreaSurface, text, area.left - drawArea.left, offset - drawArea.top, area.width() - deltax, _fgColor, alignH, deltax, ellipsis);
if (deltax >= 0) {
textArea.left += deltax;
deltax = 0;
}
font->drawString(&textAreaSurface, text, textArea.left - drawArea.left, offset - drawArea.top, textArea.width(), _fgColor, alignH, deltax, ellipsis);
}
}