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:
@ -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
|
||||
|
Reference in New Issue
Block a user