mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
Fix relative cursor mode
This commit is contained in:
@@ -633,7 +633,7 @@ void BattleFieldController::show(Canvas & to)
|
|||||||
auto cursorIndex = CCS->curh->get<Cursor::Combat>();
|
auto cursorIndex = CCS->curh->get<Cursor::Combat>();
|
||||||
auto imageIndex = static_cast<size_t>(cursorIndex);
|
auto imageIndex = static_cast<size_t>(cursorIndex);
|
||||||
|
|
||||||
canvas.draw(attackCursors->getImage(imageIndex), hexPositionAbsolute(getHoveredHex()).center() - CCS->curh->getPivotOffsetCombat(imageIndex));
|
to.draw(attackCursors->getImage(imageIndex), hexPositionAbsolute(getHoveredHex()).center() - CCS->curh->getPivotOffsetCombat(imageIndex));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,6 +15,8 @@
|
|||||||
|
|
||||||
#include "../../lib/CConfigHandler.h"
|
#include "../../lib/CConfigHandler.h"
|
||||||
#include "../CMT.h"
|
#include "../CMT.h"
|
||||||
|
#include "../CGameInfo.h"
|
||||||
|
#include "../gui/CursorHandler.h"
|
||||||
#include "../gui/CGuiHandler.h"
|
#include "../gui/CGuiHandler.h"
|
||||||
#include "../gui/EventDispatcher.h"
|
#include "../gui/EventDispatcher.h"
|
||||||
#include "../gui/MouseButton.h"
|
#include "../gui/MouseButton.h"
|
||||||
@@ -52,6 +54,9 @@ void InputSourceTouch::handleEventFingerMotion(const SDL_TouchFingerEvent & tfin
|
|||||||
};
|
};
|
||||||
|
|
||||||
GH.input().moveCursorPosition(moveDistance);
|
GH.input().moveCursorPosition(moveDistance);
|
||||||
|
if (CCS && CCS->curh)
|
||||||
|
CCS->curh->cursorMove(GH.getCursorPosition().x, GH.getCursorPosition().y);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TouchState::IDLE:
|
case TouchState::IDLE:
|
||||||
|
Reference in New Issue
Block a user