From f05baef5212d060305909140a67c7ce02f49bc47 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Wed, 19 Jun 2024 02:54:16 +0000 Subject: [PATCH] Fix oversights from 735f2d9 --- src/SFML/Window/DRM/InputImpl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/SFML/Window/DRM/InputImpl.cpp b/src/SFML/Window/DRM/InputImpl.cpp index 508819923..bd14c71f7 100644 --- a/src/SFML/Window/DRM/InputImpl.cpp +++ b/src/SFML/Window/DRM/InputImpl.cpp @@ -462,7 +462,7 @@ bool eventProcess(sf::Event& event) touchFd = fileDescriptor; break; case ABS_MT_TRACKING_ID: - atSlot(currentSlot).id = inputEvent.value; + atSlot(currentSlot).id = inputEvent.value >= 0 ? std::optional(inputEvent.value) : std::nullopt; touchFd = fileDescriptor; break; case ABS_MT_POSITION_X: @@ -657,7 +657,7 @@ bool isTouchDown(unsigned int finger) { return std::any_of(touchSlots.cbegin(), touchSlots.cend(), - [finger](const TouchSlot& slot) { return slot.id == static_cast(finger); }); + [finger](const TouchSlot& slot) { return slot.id == finger; }); } @@ -666,7 +666,7 @@ Vector2i getTouchPosition(unsigned int finger) { for (const auto& slot : touchSlots) { - if (slot.id == static_cast(finger)) + if (slot.id == finger) return slot.pos; }