diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-27 20:48:19 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-27 20:48:19 +0300 |
commit | b2f868c841bf466714796bc9ce155f411ae8df06 (patch) | |
tree | 1bef6dd9879910f577d26a81ef3b90013ec08ff0 | |
parent | 77f09ee1726fa3d8b14df52ba8f41ffd9926ad18 (diff) | |
download | manaplus-b2f868c841bf466714796bc9ce155f411ae8df06.tar.gz manaplus-b2f868c841bf466714796bc9ce155f411ae8df06.tar.bz2 manaplus-b2f868c841bf466714796bc9ce155f411ae8df06.tar.xz manaplus-b2f868c841bf466714796bc9ce155f411ae8df06.zip |
Improve a bit characterviewsmall.
-rw-r--r-- | src/gui/widgets/characterviewsmall.cpp | 10 |
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); } |