summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-01-29 00:43:16 -0700
committerIra Rice <irarice@gmail.com>2009-01-29 00:43:16 -0700
commit0a2883b61472c5dbcd419d033bd8792c335dc175 (patch)
treec1069149a13d7ece12e88dd915956cd92f039b4b /src
parenta48b3777b83f9703fb1dbde48bdc6d5f22f66a38 (diff)
downloadmana-0a2883b61472c5dbcd419d033bd8792c335dc175.tar.gz
mana-0a2883b61472c5dbcd419d033bd8792c335dc175.tar.bz2
mana-0a2883b61472c5dbcd419d033bd8792c335dc175.tar.xz
mana-0a2883b61472c5dbcd419d033bd8792c335dc175.zip
Removed useless check from the last commit.
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/textbox.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/gui/textbox.cpp b/src/gui/textbox.cpp
index c04b4262..e7986244 100644
--- a/src/gui/textbox.cpp
+++ b/src/gui/textbox.cpp
@@ -66,11 +66,8 @@ void TextBox::setTextWrapped(const std::string &text, int minDimension)
xpos = 0;
spacePos = text.rfind(" ", text.size());
- if (spacePos == std::string::npos)
- {
- spacePos = 0;
- }
- else
+
+ if (spacePos != std::string::npos)
{
const std::string word = text.substr(spacePos + 1);
const int length = getFont()->getWidth(word);
@@ -78,6 +75,7 @@ void TextBox::setTextWrapped(const std::string &text, int minDimension)
if (length > mMinWidth)
mMinWidth = length;
}
+
do
{
spacePos = line.find(" ", lastSpacePos);