diff --git a/src/main.cpp b/src/main.cpp index 7dbbbdb734e8877cd033ad83e3c9e0434b2f2f24..483f6e8ef4facad89555ed9686d5ae28d196d455 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -127,15 +127,18 @@ int main(int argc, char** argv) { /*Check if we want to get the height*/ float height_measured = NOT_ON_SURFACE; + size_t hmap_hovered_index = 99999; if (InputState::lmb_pressed && !(ImGui::GetIO().WantCaptureMouse)) { for (size_t i = 0; i < heightmaps.size(); ++i) { height_measured = heightmaps[i]->getSurfaceHeight(InputState::umpos_x, HEIGHT - InputState::umpos_y, projection, view, models[i]); if (height_measured != NOT_ON_SURFACE) { + hmap_hovered_index = i; break; } } ImGui::BeginTooltip(); - std::string tool_tip_str = "Height: "; + std::string tool_tip_str = "Height ("; + tool_tip_str += (height_measured != NOT_ON_SURFACE) ? std::to_string(hmap_hovered_index) + "): " : "-1"; tool_tip_str += (height_measured != NOT_ON_SURFACE) ? std::to_string(height_measured) + " um" : "N/A"; ImGui::Text(tool_tip_str.c_str()); ImGui::EndTooltip();