diff options
Diffstat (limited to 'src/gui/widgets/browserbox.cpp')
-rw-r--r-- | src/gui/widgets/browserbox.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp index 40c9b66a..9eee9448 100644 --- a/src/gui/widgets/browserbox.cpp +++ b/src/gui/widgets/browserbox.cpp @@ -22,8 +22,6 @@ #include "gui/widgets/browserbox.h" -#include "client.h" - #include "gui/gui.h" #include "gui/truetypefont.h" #include "gui/widgets/linkhandler.h" @@ -32,6 +30,8 @@ #include "resources/iteminfo.h" #include "resources/theme.h" +#include "utils/stringutils.h" + #include <guichan/graphics.hpp> #include <guichan/font.hpp> #include <guichan/cliprectangle.hpp> @@ -276,7 +276,7 @@ void BrowserBox::relayoutText() layoutTextRow(row, context); mLastLayoutWidth = getWidth(); - mLastLayoutTime = tick_time; + mLayoutTimer.set(100); setHeight(context.y); } @@ -507,7 +507,7 @@ void BrowserBox::maybeRelayoutText() { // Reduce relayouting frequency when there is a lot of text if (mTextRows.size() > 100) - if (mLastLayoutTime && std::abs(mLastLayoutTime - tick_time) < 10) + if (!mLayoutTimer.passed()) return; relayoutText(); |