aboutsummaryrefslogtreecommitdiff
path: root/graphics/font.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2016-03-20 19:57:42 +0100
committerJohannes Schickel2016-03-20 19:59:55 +0100
commit71c649f8d9296f51c88fbc54eca34b9dfb4d9cd1 (patch)
treeb3e7f310ec89155c6247f9fb1132cb72eee67bc5 /graphics/font.cpp
parent509a00109e79156e91c062f145ac3aa86ec8584e (diff)
downloadscummvm-rg350-71c649f8d9296f51c88fbc54eca34b9dfb4d9cd1.tar.gz
scummvm-rg350-71c649f8d9296f51c88fbc54eca34b9dfb4d9cd1.tar.bz2
scummvm-rg350-71c649f8d9296f51c88fbc54eca34b9dfb4d9cd1.zip
GRAPHICS: Mark actual dirty area as dirty in Font::drawString.
Diffstat (limited to 'graphics/font.cpp')
-rw-r--r--graphics/font.cpp8
1 files changed, 6 insertions, 2 deletions
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<Common::String> &lines) const {