GRAPHICS: Increase robustness of VectorRendererSpec::drawString.
This commit is contained in:
parent
af13b74d02
commit
a2fabef87c
1 changed files with 6 additions and 1 deletions
|
@ -738,7 +738,12 @@ drawString(const Graphics::Font *font, const Common::String &text, const Common:
|
||||||
// the text (area).
|
// the text (area).
|
||||||
drawArea = textDrawableArea.findIntersectingRect(area);
|
drawArea = textDrawableArea.findIntersectingRect(area);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Better safe than sorry. We intersect with the actual surface boundaries
|
||||||
|
// to avoid any ugly clipping in _activeSurface->getSubArea which messes
|
||||||
|
// up the calculation of the x and y coordinates where to draw the string.
|
||||||
|
drawArea = drawArea.findIntersectingRect(Common::Rect(0, 0, _activeSurface->w, _activeSurface->h));
|
||||||
|
|
||||||
if (!drawArea.isEmpty()) {
|
if (!drawArea.isEmpty()) {
|
||||||
Surface textAreaSurface = _activeSurface->getSubArea(drawArea);
|
Surface textAreaSurface = _activeSurface->getSubArea(drawArea);
|
||||||
font->drawString(&textAreaSurface, text, area.left - drawArea.left, offset - drawArea.top, area.width() - deltax, _fgColor, alignH, deltax, ellipsis);
|
font->drawString(&textAreaSurface, text, area.left - drawArea.left, offset - drawArea.top, area.width() - deltax, _fgColor, alignH, deltax, ellipsis);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue