1
0
Fork 0
mirror of https://github.com/gwm17/implot.git synced 2024-11-26 20:28:50 -05:00

fix bug in demo

This commit is contained in:
Evan Pezent 2020-04-27 17:18:12 -05:00
parent c027445766
commit fee519b3e9

View File

@ -175,6 +175,7 @@ void ShowImPlotDemoWindow(bool* p_open) {
} }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
if (ImGui::CollapsingHeader("Realtime Plots")) { if (ImGui::CollapsingHeader("Realtime Plots")) {
ImGui::BulletText("Move your mouse to change the data!");
static bool paused = false; static bool paused = false;
static ScrollingData sdata1, sdata2; static ScrollingData sdata1, sdata2;
static RollingData rdata1, rdata2; static RollingData rdata1, rdata2;
@ -301,6 +302,7 @@ void ShowImPlotDemoWindow(bool* p_open) {
if (ImGui::IsPlotHovered() && ImGui::IsMouseClicked(0)) if (ImGui::IsPlotHovered() && ImGui::IsMouseClicked(0))
data.push_back(ImGui::GetPlotMousePos()); data.push_back(ImGui::GetPlotMousePos());
ImGui::PushPlotStyleVar(ImPlotStyleVar_Marker, ImMarker_Diamond); ImGui::PushPlotStyleVar(ImPlotStyleVar_Marker, ImMarker_Diamond);
if (data.size() > 0)
ImGui::Plot("Art", &data[0].x, &data[0].y, data.size(), 0, 2 * sizeof(float)); ImGui::Plot("Art", &data[0].x, &data[0].y, data.size(), 0, 2 * sizeof(float));
ImGui::PopPlotStyleVar(); ImGui::PopPlotStyleVar();
ImGui::EndPlot(); ImGui::EndPlot();