1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-27 00:41:08 +02:00

Fix zooming with keyboard shortcuts

This commit is contained in:
Ivan Savenko
2024-05-19 09:58:55 +00:00
parent 11c00711f9
commit 16f963bed5
8 changed files with 21 additions and 18 deletions

View File

@ -87,7 +87,7 @@ void MapViewActions::mouseMoved(const Point & cursorPosition, const Point & last
void MapViewActions::wheelScrolled(int distance)
{
adventureInt->hotkeyZoom(distance * 4);
adventureInt->hotkeyZoom(distance * 4, true);
}
void MapViewActions::mouseDragged(const Point & cursorPosition, const Point & lastUpdateDistance)
@ -114,7 +114,7 @@ void MapViewActions::gesturePinch(const Point & centerPosition, double lastUpdat
int oldZoomSteps = std::round(std::log(pinchZoomFactor) / std::log(1.01));
if (newZoomSteps != oldZoomSteps)
adventureInt->hotkeyZoom(newZoomSteps - oldZoomSteps);
adventureInt->hotkeyZoom(newZoomSteps - oldZoomSteps, true);
pinchZoomFactor = newZoom;
}