From e72f04528e93273af138375a68b09b5907fce964 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Wed, 4 Feb 2009 13:30:51 -0700 Subject: Since they're now doing the same thing, having a branch is a little bit silly. Condensed the sizing code for speech bubbles to do the same for speech bubbles of all sizes. Signed-off-by: Ira Rice --- src/gui/speechbubble.cpp | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'src/gui/speechbubble.cpp') diff --git a/src/gui/speechbubble.cpp b/src/gui/speechbubble.cpp index 0e58825c..b2c66ff2 100644 --- a/src/gui/speechbubble.cpp +++ b/src/gui/speechbubble.cpp @@ -75,22 +75,12 @@ void SpeechBubble::setText(std::string mText) const int numRows = mSpeechBox->getNumberOfRows() + 1; int width = mCaption->getWidth() + 3; - if (numRows > 2) - { - if (width < mSpeechBox->getMinWidth()) - width = mSpeechBox->getMinWidth(); - setContentSize(width + fontHeight, (numRows * fontHeight) + 6); - mSpeechArea->setDimension(gcn::Rectangle(4, fontHeight + 3, width + 5, - (numRows * fontHeight))); - } - else - { - if (width < getFont()->getWidth(mText)) - width = getFont()->getWidth(mText); - setContentSize(width + fontHeight, (fontHeight * 2) + 6); - mSpeechArea->setDimension(gcn::Rectangle(4, fontHeight + 3, - width, fontHeight)); - } + if (width < mSpeechBox->getMinWidth()) + width = mSpeechBox->getMinWidth(); + + setContentSize(width + fontHeight, (numRows * fontHeight) + 6); + mSpeechArea->setDimension(gcn::Rectangle(4, fontHeight + 3, width + 5, + (numRows * fontHeight))); } unsigned int SpeechBubble::getNumRows() -- cgit v1.2.3-70-g09d2