summaryrefslogtreecommitdiff
path: root/src/gui/widgets/characterviewsmall.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/characterviewsmall.cpp')
-rw-r--r--src/gui/widgets/characterviewsmall.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/widgets/characterviewsmall.cpp b/src/gui/widgets/characterviewsmall.cpp
index 7e327c29f..fd9240936 100644
--- a/src/gui/widgets/characterviewsmall.cpp
+++ b/src/gui/widgets/characterviewsmall.cpp
@@ -101,17 +101,19 @@ void CharacterViewSmall::resize()
if (sz <= 0)
return;
const CharacterDisplay *const firtChar = (*mCharacterEntries)[0];
- const int x = (getWidth() - firtChar->getWidth()) / 2;
- const int y = (getHeight() - firtChar->getHeight()) / 2;
+ const int w = mDimension.width;
+ const int h = mDimension.height;
+ const int x = (w - firtChar->getWidth()) / 2;
+ const int y = (h - firtChar->getHeight()) / 2;
FOR_EACHP (std::vector<CharacterDisplay*>::iterator,
it, mCharacterEntries)
{
(*it)->setPosition(x, y);
}
- const int y2 = (getHeight() - mPrevious->getHeight()) / 2;
+ const int y2 = (h - mPrevious->getHeight()) / 2;
const int y3 = y2 - 55;
mPrevious->setPosition(x - mPrevious->getWidth() - 10, y3);
- mNext->setPosition(getWidth() - x + 10, y3);
+ mNext->setPosition(w - x + 10, y3);
mNumber->setPosition(10, y2);
}