Skip to content

Commit

Permalink
fix bug in dnd demo
Browse files Browse the repository at this point in the history
  • Loading branch information
epezent committed May 22, 2020
1 parent 98ff9e8 commit aa13f3c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions implot_demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ void ShowDemoWindow(bool* p_open) {
ImGui::Separator();
for (int i = 0; i < 10; ++i) {
char label[8];
sprintf(label, "data_%d", i);
sprintf(label, show[i] ? "data_%d*" : "data_%d", i);
ImGui::Selectable(label, false, 0, ImVec2(100, 0));
if (ImGui::BeginDragDropSource(ImGuiDragDropFlags_None)) {
ImGui::SetDragDropPayload("DND_PLOT", &i, sizeof(int));
Expand All @@ -575,7 +575,7 @@ void ShowDemoWindow(bool* p_open) {
ImPlot::SetNextPlotLimitsX(t - 10, t, paused ? ImGuiCond_Once : ImGuiCond_Always);
if (ImPlot::BeginPlot("##DND")) {
for (int i = 0; i < 10; ++i) {
if (show[i]) {
if (show[i] && data[i].Data.size() > 0) {
char label[8];
sprintf(label, "data_%d", i);
ImPlot::PlotLine(label, &data[i].Data[0].x, &data[i].Data[0].y, data[i].Data.size(), data[i].Offset, 2 * sizeof(float));
Expand Down Expand Up @@ -678,7 +678,7 @@ void ShowDemoWindow(bool* p_open) {
ImPlot::SetNextPlotLimitsX(t - 10.0f, t, paused ? ImGuiCond_Once : ImGuiCond_Always);
if (ImPlot::BeginPlot("##Digital")) {
for (int i = 0; i < K_PLOT_DIGITAL_CH_COUNT; ++i) {
if (showDigital[i]) {
if (showDigital[i] && dataDigital[i].Data.size() > 0) {
char label[32];
sprintf(label, "digital_%d", i);
ImPlot::PushStyleVar(ImPlotStyleVar_DigitalBitHeight, bitHeight);
Expand Down

0 comments on commit aa13f3c

Please sign in to comment.