Skip to content

Commit

Permalink
refactor: switch marker drawing loop to for each
Browse files Browse the repository at this point in the history
  • Loading branch information
vtx22 committed Mar 7, 2025
1 parent 6504ad3 commit df6fdc8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/PlottingWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ void PlottingWindow::update_content()
update_axes();

auto &markers = _data_handler->get_markers();
for (uint32_t m = 0; m < markers.size(); m++)

size_t id = 0;
for (auto &m : markers)
{
if (markers[m].hidden)
if (m.hidden)
{
continue;
}

ImPlot::DragLineX(m, &markers[m].x, markers[m].color, 2);
ImPlot::TagX(markers[m].x, markers[m].color, markers[m].name.c_str());
ImPlot::DragLineX(id++, &m.x, m.color, 2);
ImPlot::TagX(m.x, m.color, m.name.c_str());
}

ImPlotContext *ctx = ImPlot::GetCurrentContext();
Expand Down

0 comments on commit df6fdc8

Please sign in to comment.