mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-23 00:28:08 +02:00
Haptic feedback and increased dead zone
This commit is contained in:
client/mapView
@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user