From 41927e802c376231ef86b8d4ff7b3f486a9adaa5 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Mon, 14 Aug 2023 15:33:41 +0100 Subject: [PATCH] st/gui: Fix warning by using safe casts --- src/xrt/state_trackers/gui/gui_scene_remote.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/xrt/state_trackers/gui/gui_scene_remote.c b/src/xrt/state_trackers/gui/gui_scene_remote.c index 8294424aa..5a7b12919 100644 --- a/src/xrt/state_trackers/gui/gui_scene_remote.c +++ b/src/xrt/state_trackers/gui/gui_scene_remote.c @@ -13,6 +13,7 @@ #include "util/u_logging.h" #include "math/m_api.h" +#include "math/m_vec2.h" #include "gui_common.h" #include "gui_imgui.h" @@ -141,13 +142,13 @@ handle_input(struct r_remote_controller_data *d) touched = false; d->thumbstick_click = handle_downable_button("Thumbstick Click"); touched |= igIsItemHovered(ImGuiHoveredFlags_RectOnly); - igSliderFloat2("Thumbstick", &d->thumbstick.x, -1, 1, "%.2f", 0); + igSliderFloat2("Thumbstick", *m_vec2_ptr_to_float_arr_ptr(&d->thumbstick), -1, 1, "%.2f", 0); touched |= igIsItemHovered(ImGuiHoveredFlags_RectOnly); d->thumbstick_touch = touched; // Trackpad touched = false; - igSliderFloat2("Trackpad", &d->trackpad.x, -1, 1, "%.2f", 0); + igSliderFloat2("Trackpad", *m_vec2_ptr_to_float_arr_ptr(&d->trackpad), -1, 1, "%.2f", 0); touched |= igIsItemHovered(ImGuiHoveredFlags_RectOnly); igSliderFloat("Trackpad Force", &d->trackpad_force.x, 0, 1, "%.2f", 0); touched |= igIsItemHovered(ImGuiHoveredFlags_RectOnly);