Loading include/input/InputTransport.h +7 −0 Original line number Original line Diff line number Diff line Loading @@ -384,6 +384,10 @@ private: const PointerCoords& getPointerById(uint32_t id) const { const PointerCoords& getPointerById(uint32_t id) const { return pointers[idToIndex[id]]; return pointers[idToIndex[id]]; } } bool hasPointerId(uint32_t id) const { return idBits.hasBit(id); } }; }; struct TouchState { struct TouchState { int32_t deviceId; int32_t deviceId; Loading Loading @@ -419,6 +423,9 @@ private: if (historySize < 2) { if (historySize < 2) { return false; return false; } } if (!getHistory(0)->hasPointerId(id) || !getHistory(1)->hasPointerId(id)) { return false; } float currentX = getHistory(0)->getPointerById(id).getX(); float currentX = getHistory(0)->getPointerById(id).getX(); float currentY = getHistory(0)->getPointerById(id).getY(); float currentY = getHistory(0)->getPointerById(id).getY(); float previousX = getHistory(1)->getPointerById(id).getX(); float previousX = getHistory(1)->getPointerById(id).getX(); Loading Loading
include/input/InputTransport.h +7 −0 Original line number Original line Diff line number Diff line Loading @@ -384,6 +384,10 @@ private: const PointerCoords& getPointerById(uint32_t id) const { const PointerCoords& getPointerById(uint32_t id) const { return pointers[idToIndex[id]]; return pointers[idToIndex[id]]; } } bool hasPointerId(uint32_t id) const { return idBits.hasBit(id); } }; }; struct TouchState { struct TouchState { int32_t deviceId; int32_t deviceId; Loading Loading @@ -419,6 +423,9 @@ private: if (historySize < 2) { if (historySize < 2) { return false; return false; } } if (!getHistory(0)->hasPointerId(id) || !getHistory(1)->hasPointerId(id)) { return false; } float currentX = getHistory(0)->getPointerById(id).getX(); float currentX = getHistory(0)->getPointerById(id).getX(); float currentY = getHistory(0)->getPointerById(id).getY(); float currentY = getHistory(0)->getPointerById(id).getY(); float previousX = getHistory(1)->getPointerById(id).getX(); float previousX = getHistory(1)->getPointerById(id).getX(); Loading