diff --git a/client/mapView/MapViewController.cpp b/client/mapView/MapViewController.cpp index 46668da5b..5d865ec69 100644 --- a/client/mapView/MapViewController.cpp +++ b/client/mapView/MapViewController.cpp @@ -20,6 +20,7 @@ #include "../adventureMap/AdventureMapInterface.h" #include "../gui/CGuiHandler.h" #include "../gui/WindowHandler.h" +#include "../eventsSDL/InputHandler.h" #include "../../lib/CConfigHandler.h" #include "../../lib/mapObjects/CGHeroInstance.h" @@ -118,6 +119,14 @@ void MapViewController::modifyTileSize(int stepsChange) actualZoom.x = defaultTileSize; if(actualZoom.y >= defaultTileSize - zoomTileDeadArea && actualZoom.y <= defaultTileSize + zoomTileDeadArea) actualZoom.y = defaultTileSize; + + bool isInDeadZone = targetTileSize != actualZoom; + + if(!wasInDeadZone && isInDeadZone) + GH.input().hapticFeedback(); + + wasInDeadZone = isInDeadZone; + setTileSize(actualZoom); } } diff --git a/client/mapView/MapViewController.h b/client/mapView/MapViewController.h index 32db5b7c4..3a23b917e 100644 --- a/client/mapView/MapViewController.h +++ b/client/mapView/MapViewController.h @@ -51,8 +51,9 @@ class MapViewController : public IMapObjectObserver private: const int defaultTileSize = 32; - const int zoomTileDeadArea = 4; + const int zoomTileDeadArea = 5; Point targetTileSize = Point(32, 32); + bool wasInDeadZone = true; bool isEventInstant(const CGObjectInstance * obj); bool isEventVisible(const CGObjectInstance * obj);