1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

angle calc

This commit is contained in:
Michael
2023-08-26 20:19:25 +02:00
committed by GitHub
parent bd0f9bb280
commit fe6d96f4a0
3 changed files with 14 additions and 1 deletions

View File

@ -129,8 +129,14 @@ void MapView::onMapSwiped(const Point & viewPosition)
}
void MapView::postSwipe(uint32_t msPassed) {
if(!actions->dragActive)
if(!actions->dragActive && swipeHistory.size() > 0)
{
Point diff = swipeHistory.end()->second - swipeHistory.begin()->second;
double angle = diff.angle();
std::cout << angle;
swipeHistory.clear();
}
}
void MapView::onCenteredTile(const int3 & tile)