mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-08 20:50:19 -06:00
Touch: Added a firstInput so that if we ever get more than
max amount of inputs in our Deque, we will still have our first point stored (for pinching around a start-centroid mainly)
This commit is contained in:
@@ -80,6 +80,7 @@ public:
|
||||
private:
|
||||
//A deque of recorded inputs. Adding newer points to the front of the queue
|
||||
std::deque<TouchInput> _inputs;
|
||||
TouchInput _firstInput;
|
||||
|
||||
size_t _touchDeviceId;
|
||||
size_t _fingerId;
|
||||
|
||||
@@ -73,6 +73,7 @@ float TouchInput::angleToPos(float otherX, float otherY) const {
|
||||
|
||||
TouchInputHolder::TouchInputHolder(TouchInput input)
|
||||
: _inputs{ input }
|
||||
, _firstInput(input)
|
||||
, _touchDeviceId(input.touchDeviceId)
|
||||
, _fingerId(input.fingerId)
|
||||
{}
|
||||
@@ -182,7 +183,7 @@ size_t TouchInputHolder::numInputs() const {
|
||||
}
|
||||
|
||||
const TouchInput& TouchInputHolder::firstInput() const {
|
||||
return _inputs.back();
|
||||
return _firstInput;
|
||||
}
|
||||
|
||||
const TouchInput& TouchInputHolder::latestInput() const {
|
||||
|
||||
Reference in New Issue
Block a user