summaryrefslogtreecommitdiffstats
path: root/src/input_common/touch_from_button.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/input_common/touch_from_button.cpp')
-rw-r--r--src/input_common/touch_from_button.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/input_common/touch_from_button.cpp b/src/input_common/touch_from_button.cpp
index a07124a86..ffbe4f2ed 100644
--- a/src/input_common/touch_from_button.cpp
+++ b/src/input_common/touch_from_button.cpp
@@ -25,18 +25,19 @@ public:
}
}
- std::tuple<float, float, bool> GetStatus() const override {
- for (const auto& m : map) {
- const bool state = std::get<0>(m)->GetStatus();
+ Input::TouchStatus GetStatus() const override {
+ Input::TouchStatus touch_status{};
+ for (std::size_t id = 0; id < map.size() && id < touch_status.size(); ++id) {
+ const bool state = std::get<0>(map[id])->GetStatus();
if (state) {
- const float x = static_cast<float>(std::get<1>(m)) /
+ const float x = static_cast<float>(std::get<1>(map[id])) /
static_cast<int>(Layout::ScreenUndocked::Width);
- const float y = static_cast<float>(std::get<2>(m)) /
+ const float y = static_cast<float>(std::get<2>(map[id])) /
static_cast<int>(Layout::ScreenUndocked::Height);
- return {x, y, true};
+ touch_status[id] = {x, y, true};
}
}
- return {};
+ return touch_status;
}
private: