diff options
author | Ira Rice <irarice@gmail.com> | 2009-02-04 13:30:51 -0700 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-02-04 13:30:51 -0700 |
commit | e72f04528e93273af138375a68b09b5907fce964 (patch) | |
tree | 6a58261c3873b21d238f1fd374d34c83f1a1caf0 /src | |
parent | ed6a1d2fb487580fe3aee5ed7e0cf3fe091032f8 (diff) | |
download | mana-e72f04528e93273af138375a68b09b5907fce964.tar.gz mana-e72f04528e93273af138375a68b09b5907fce964.tar.bz2 mana-e72f04528e93273af138375a68b09b5907fce964.tar.xz mana-e72f04528e93273af138375a68b09b5907fce964.zip |
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 <irarice@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/speechbubble.cpp | 22 |
1 files changed, 6 insertions, 16 deletions
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() |