From 71c649f8d9296f51c88fbc54eca34b9dfb4d9cd1 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 20 Mar 2016 19:57:42 +0100 Subject: GRAPHICS: Mark actual dirty area as dirty in Font::drawString. --- graphics/font.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'graphics') diff --git a/graphics/font.cpp b/graphics/font.cpp index d709758948..4214b3f41b 100644 --- a/graphics/font.cpp +++ b/graphics/font.cpp @@ -276,12 +276,16 @@ void Font::drawString(Surface *dst, const Common::U32String &str, int x, int y, void Font::drawString(ManagedSurface *dst, const Common::String &str, int x, int y, int w, uint32 color, TextAlign align, int deltax, bool useEllipsis) const { drawString(&dst->_innerSurface, str, x, y, w, color, align, deltax, useEllipsis); - dst->addDirtyRect(Common::Rect(x, y, x + w, y + getFontHeight())); + if (w != 0) { + dst->addDirtyRect(getBoundingBox(str, x, y, w, align)); + } } void Font::drawString(ManagedSurface *dst, const Common::U32String &str, int x, int y, int w, uint32 color, TextAlign align) const { drawString(&dst->_innerSurface, str, x, y, w, color, align); - dst->addDirtyRect(Common::Rect(x, y, x + w, y + getFontHeight())); + if (w != 0) { + dst->addDirtyRect(getBoundingBox(str, x, y, w, align)); + } } int Font::wordWrapText(const Common::String &str, int maxWidth, Common::Array &lines) const { -- cgit v1.2.3