diff options
Diffstat (limited to 'src/core/hid/input_converter.cpp')
| -rw-r--r-- | src/core/hid/input_converter.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/hid/input_converter.cpp b/src/core/hid/input_converter.cpp index 3c26260f3..18d9f042d 100644 --- a/src/core/hid/input_converter.cpp +++ b/src/core/hid/input_converter.cpp | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include <algorithm> | ||
| 4 | #include <random> | 5 | #include <random> |
| 5 | 6 | ||
| 6 | #include "common/input.h" | 7 | #include "common/input.h" |
| @@ -196,6 +197,9 @@ Common::Input::TouchStatus TransformToTouch(const Common::Input::CallbackStatus& | |||
| 196 | x = std::clamp(x, 0.0f, 1.0f); | 197 | x = std::clamp(x, 0.0f, 1.0f); |
| 197 | y = std::clamp(y, 0.0f, 1.0f); | 198 | y = std::clamp(y, 0.0f, 1.0f); |
| 198 | 199 | ||
| 200 | // Limit id to maximum number of fingers | ||
| 201 | status.id = std::clamp(status.id, 0, 16); | ||
| 202 | |||
| 199 | if (status.pressed.inverted) { | 203 | if (status.pressed.inverted) { |
| 200 | status.pressed.value = !status.pressed.value; | 204 | status.pressed.value = !status.pressed.value; |
| 201 | } | 205 | } |