mirror of
https://github.com/gwm17/implot.git
synced 2024-11-23 02:38:53 -05:00
fix bug in demo
This commit is contained in:
parent
c027445766
commit
fee519b3e9
|
@ -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,7 +302,8 @@ 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);
|
||||||
ImGui::Plot("Art", &data[0].x, &data[0].y, data.size(), 0, 2 * sizeof(float));
|
if (data.size() > 0)
|
||||||
|
ImGui::Plot("Art", &data[0].x, &data[0].y, data.size(), 0, 2 * sizeof(float));
|
||||||
ImGui::PopPlotStyleVar();
|
ImGui::PopPlotStyleVar();
|
||||||
ImGui::EndPlot();
|
ImGui::EndPlot();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user