From b2f868c841bf466714796bc9ce155f411ae8df06 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 27 May 2015 20:48:19 +0300 Subject: Improve a bit characterviewsmall. --- src/gui/widgets/characterviewsmall.cpp | 10 ++++++---- 1 file 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::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); } -- cgit v1.2.3-70-g09d2