From 4288b9f41b524326b6bbe294cd8e8980353c5e66 Mon Sep 17 00:00:00 2001 From: Pascal <engelerp@phys.ethz.ch> Date: Wed, 26 Jul 2023 17:56:24 +0200 Subject: [PATCH] Added position display --- gui/src/main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gui/src/main.cpp b/gui/src/main.cpp index a0ae730..5e86b98 100644 --- a/gui/src/main.cpp +++ b/gui/src/main.cpp @@ -218,6 +218,16 @@ int main(int argc, char** argv) { } } } + ImGui::NewLine(); + ImGui::Separator(); + ImGui::NewLine(); + glm::vec2 m_real_world = camera.GetWorldXyFromMouse(InputState::mpos_x, InputState::mpos_y); + std::ostringstream xstr; + xstr << std::fixed << m_real_world.x; + std::ostringstream ystr; + ystr << std::fixed << m_real_world.y; + text = "Mouse Position: (" + xstr.str() + ", " + ystr.str() + ")"; + ImGui::Text(text.c_str()); ImGui::End(); //Layer Window -- GitLab