summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-27 20:48:19 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-27 20:48:19 +0300
commitb2f868c841bf466714796bc9ce155f411ae8df06 (patch)
tree1bef6dd9879910f577d26a81ef3b90013ec08ff0
parent77f09ee1726fa3d8b14df52ba8f41ffd9926ad18 (diff)
downloadplus-b2f868c841bf466714796bc9ce155f411ae8df06.tar.gz
plus-b2f868c841bf466714796bc9ce155f411ae8df06.tar.bz2
plus-b2f868c841bf466714796bc9ce155f411ae8df06.tar.xz
plus-b2f868c841bf466714796bc9ce155f411ae8df06.zip
Improve a bit characterviewsmall.
-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);
}