summaryrefslogtreecommitdiff
path: root/src/guichan/widgets/textfield.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/guichan/widgets/textfield.cpp')
-rw-r--r--src/guichan/widgets/textfield.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/guichan/widgets/textfield.cpp b/src/guichan/widgets/textfield.cpp
index b74d2333f..2fffdc5f5 100644
--- a/src/guichan/widgets/textfield.cpp
+++ b/src/guichan/widgets/textfield.cpp
@@ -132,7 +132,8 @@ namespace gcn
{
if (isFocused())
{
- int caretX = getFont()->getWidth(mText.substr(0, mCaretPosition));
+ const int caretX = getFont()->getWidth(
+ mText.substr(0, mCaretPosition));
if (caretX - mXScroll >= getWidth() - 4)
{