1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Test version of swipe gesture for in-combat attacks

This commit is contained in:
Ivan Savenko
2023-05-31 00:33:10 +03:00
parent 70155b48e1
commit b20109c830
20 changed files with 79 additions and 104 deletions

View File

@@ -20,7 +20,7 @@ Scrollable::Scrollable(int used, Point position, Orientation orientation)
{
}
void Scrollable::panning(bool on)
void Scrollable::panning(bool on, const Point & initialPosition, const Point & finalPosition)
{
panningDistanceAccumulated = 0;
}
@@ -33,12 +33,12 @@ void Scrollable::wheelScrolled(int distance)
scrollBy(-distance * scrollStep);
}
void Scrollable::gesturePanning(const Point & distanceDelta)
void Scrollable::gesturePanning(const Point & initialPosition, const Point & currentPosition, const Point & lastUpdateDistance)
{
if (orientation == Orientation::HORIZONTAL)
panningDistanceAccumulated += -distanceDelta.x;
panningDistanceAccumulated += -lastUpdateDistance.x;
else
panningDistanceAccumulated += distanceDelta.y;
panningDistanceAccumulated += lastUpdateDistance.y;
if (-panningDistanceAccumulated > panningDistanceSingle )
{