summaryrefslogtreecommitdiff
path: root/src/gui/npc_text.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/npc_text.cpp')
-rw-r--r--src/gui/npc_text.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/gui/npc_text.cpp b/src/gui/npc_text.cpp
index b2256f07..1e29b793 100644
--- a/src/gui/npc_text.cpp
+++ b/src/gui/npc_text.cpp
@@ -64,12 +64,8 @@ NpcTextDialog::NpcTextDialog():
void NpcTextDialog::setText(const std::string &text)
{
- const gcn::Rectangle &area = getChildrenArea();
- const int width = area.width;
-
mText = text;
- mTextBox->setMinWidth(width - 30);
- mTextBox->setTextWrapped(mText);
+ mTextBox->setTextWrapped(mText, scrollArea->getWidth() - 15);
}
void NpcTextDialog::addText(const std::string &text)
@@ -93,12 +89,6 @@ void NpcTextDialog::widgetResized(const gcn::Event &event)
{
Window::widgetResized(event);
- const gcn::Rectangle &area = getChildrenArea();
-
- mTextBox->setMinWidth(area.width - 30);
- mTextBox->setTextWrapped(mText);
-
- // Set the text again so that it gets wrapped according to the new size
- mTextBox->setTextWrapped(mText);
+ setText(mText);
}