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

Merge pull request #2163 from IvanSavenko/adventure_map_zoom

Adventure map zoom
This commit is contained in:
Ivan Savenko
2023-05-20 13:35:53 +03:00
committed by GitHub
16 changed files with 109 additions and 8 deletions

View File

@ -29,7 +29,7 @@ MapViewActions::MapViewActions(MapView & owner, const std::shared_ptr<MapViewMod
pos.w = model->getPixelsVisibleDimensions().x;
pos.h = model->getPixelsVisibleDimensions().y;
addUsedEvents(LCLICK | RCLICK | MCLICK | HOVER | MOVE);
addUsedEvents(LCLICK | RCLICK | MCLICK | HOVER | MOVE | WHEEL);
}
bool MapViewActions::swipeEnabled() const
@ -92,6 +92,13 @@ void MapViewActions::mouseMoved(const Point & cursorPosition)
handleSwipeMove(cursorPosition);
}
void MapViewActions::wheelScrolled(bool down, bool in)
{
if (!in)
return;
adventureInt->hotkeyZoom(down ? -1 : +1);
}
void MapViewActions::handleSwipeMove(const Point & cursorPosition)
{
// unless swipe is enabled, swipe move only works with middle mouse button