# HG changeset patch # User rubidium # Date 1189199732 0 # Node ID 417613ef92fa85284fabf81dd8f1fc8bcbd696d8 # Parent 2e4dcc2c3bc949179a9d3b04916dba7dd135905b (svn r11055) -Fix [FS#1214]: loading indicators would sometimes glitch due to a bounding box that was too small. Patch by frosch. diff -r 2e4dcc2c3bc9 -r 417613ef92fa src/texteff.cpp --- a/src/texteff.cpp Fri Sep 07 21:11:12 2007 +0000 +++ b/src/texteff.cpp Fri Sep 07 21:15:32 2007 +0000 @@ -259,6 +259,7 @@ /** Text Effects */ static void MarkTextEffectAreaDirty(TextEffect *te) { + /* Width and height of the text effect are doubled, so they are correct in both zoom out levels 1x and 2x. */ MarkAllViewportsDirty( te->x, te->y - 1, @@ -321,6 +322,15 @@ te->params_1 = GetDParam(0); te->params_2 = GetDParam(4); + /* Update width of text effect */ + char buffer[100]; + GetString(buffer, msg, lastof(buffer)); + int w = GetStringBoundingBox(buffer).width; + + /* Only allow to make it broader, so it completely covers the old text. That avoids remnants of the old text. */ + int right_new = te->x + w; + if (te->right < right_new) te->right = right_new; + MarkTextEffectAreaDirty(te); }