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

compatible with older sdl

This commit is contained in:
Michael
2023-08-26 22:30:02 +02:00
committed by GitHub
parent cde22b3755
commit a354a7f696
4 changed files with 5 additions and 5 deletions

View File

@ -137,7 +137,7 @@ void MapView::postSwipe(uint32_t msPassed) {
for (auto & x : swipeHistory)
diff += x.second;
uint64_t timediff = swipeHistory.rbegin()->first - swipeHistory.begin()->first;
uint32_t timediff = swipeHistory.rbegin()->first - swipeHistory.begin()->first;
postSwipeAngle = diff.angle();
postSwipeSpeed = static_cast<double>(diff.length()) / static_cast<double>(timediff); // unit: pixel/millisecond