summaryrefslogtreecommitdiff
path: root/src/gui/speechbubble.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/speechbubble.cpp')
-rw-r--r--src/gui/speechbubble.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/gui/speechbubble.cpp b/src/gui/speechbubble.cpp
index d71ceedf..c5c653e7 100644
--- a/src/gui/speechbubble.cpp
+++ b/src/gui/speechbubble.cpp
@@ -61,8 +61,8 @@ SpeechBubble::SpeechBubble()//:
void SpeechBubble::setText(const std::string mText)
{
- mSpeechBox->setTextWrapped( mText );
mSpeechBox->setMinWidth(140);
+ mSpeechBox->setTextWrapped( mText );
int numRows = mSpeechBox->getNumberOfRows();
@@ -76,10 +76,8 @@ void SpeechBubble::setText(const std::string mText)
}
else
{
- int width;
- if (this->getCaption().length() > mText.length())
- width = getFont()->getWidth(this->getCaption());
- else
+ int width = getFont()->getWidth(this->getCaption());
+ if (width < getFont()->getWidth(mText))
width = getFont()->getWidth(mText);
setContentSize(width + 15, 30);
mSpeechArea->setDimension(gcn::Rectangle(4, 15, width + 5, 17));