Add current time marker

This commit is contained in:
illyum 2024-08-08 23:46:20 -06:00
parent e78c0fa96a
commit 1c4c092967

View File

@ -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;