diff options
Diffstat (limited to 'src/touchmanager.cpp')
-rw-r--r-- | src/touchmanager.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/touchmanager.cpp b/src/touchmanager.cpp index 0b2b85562..c036f2594 100644 --- a/src/touchmanager.cpp +++ b/src/touchmanager.cpp @@ -52,6 +52,8 @@ TouchManager::TouchManager() : mButtonsSize(1), mJoystickSize(1), mButtonsFormat(0), + mWidth(0), + mHeight(0), mShow(false), mInGame(false), mTempHideButtons(false) @@ -99,6 +101,8 @@ void TouchManager::init() loadPad(); if (mShowButtons) loadButtons(); + mWidth = mainGraphics->mWidth; + mHeight = mainGraphics->mHeight; } void TouchManager::loadTouchItem(TouchItem **item, const std::string &name, @@ -309,8 +313,8 @@ bool TouchManager::isActionActive(const int index) const void TouchManager::resize(const int width, const int height) { mRedraw = true; - const int maxHeight = mainGraphics->mHeight; - const int diffW = width - mainGraphics->mWidth; + const int maxHeight = mHeight; + const int diffW = width - mWidth; const int diffH = height - maxHeight; FOR_EACH (TouchItemVectorCIter, it, mObjects) { @@ -340,6 +344,8 @@ void TouchManager::resize(const int width, const int height) break; } } + mWidth = mainGraphics->mWidth; + mHeight = mainGraphics->mHeight; } void TouchManager::unload(TouchItem *const item) |