From 1c4c0929677b8cf0121941e3797a0595bcfc0b01 Mon Sep 17 00:00:00 2001 From: illyum <90023277+itzilly@users.noreply.github.com> Date: Thu, 8 Aug 2024 23:46:20 -0600 Subject: [PATCH] Add current time marker --- main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.cpp b/main.cpp index 32995a3..4b28200 100644 --- a/main.cpp +++ b/main.cpp @@ -244,6 +244,10 @@ void renderImGui() { } } + // Draw the current timeline position marker + float position_marker = (timeline_position * zoom_level - pan_offset) / timeline_duration * timeline_width; + draw_list->AddLine(ImVec2(cursor_pos.x + position_marker, cursor_pos.y), ImVec2(cursor_pos.x + position_marker, cursor_pos.y + 100), IM_COL32(0, 0, 255, 255), 2.0f); + // Allow adding markers with snapping to grid if (ImGui::Button("Add Marker")) { float snap_position = std::round(timeline_position / beat_interval) * beat_interval;