1
0
Fork 0
mirror of https://github.com/gwm17/implot.git synced 2024-11-26 12:18:52 -05:00

test negative offset, add to demo

This commit is contained in:
Evan Pezent 2020-05-13 08:43:33 -05:00
parent e6003e3029
commit b11fb62f55

View File

@ -706,6 +706,20 @@ void ShowDemoWindow(bool* p_open) {
}
}
//-------------------------------------------------------------------------
if (ImGui::CollapsingHeader("Offset Data")) {
float xs[50], ys[50];
for (int i = 0; i < 50; ++i) {
xs[i] = 0.5 + 0.4 * cos(i/50.f * 6.28);
ys[i] = 0.5 + 0.4 * sin(i/50.f * 6.28);
}
static int offset = 0;
ImGui::SliderInt("Offset", &offset, -100, 100);
if (ImPlot::BeginPlot("##offset")) {
ImPlot::Plot("circle", xs, ys, 50, offset);
ImPlot::EndPlot();
}
}
//-------------------------------------------------------------------------
if (ImGui::CollapsingHeader("Custom Styles")) {
static ImVec4 my_palette[3] = {
{0.000f, 0.980f, 0.604f, 1.0f},