mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 21:05:56 -05:00
@@ -51,14 +51,13 @@ namespace hex::plugin::builtin {
|
||||
auto dataPattern = arguments[0].toPattern();
|
||||
|
||||
if (ImPlot::BeginPlot("##plot", ImVec2(400, 250), ImPlotFlags_NoChild | ImPlotFlags_CanvasOnly)) {
|
||||
ImPlot::SetupAxes("X", "Y", ImPlotAxisFlags_AutoFit, ImPlotAxisFlags_AutoFit);
|
||||
|
||||
if (shouldReset) {
|
||||
values.clear();
|
||||
values = sampleData(patternToArray<float>(dataPattern), ImPlot::GetPlotSize().x * 4);
|
||||
}
|
||||
|
||||
ImPlot::SetupAxes("X", "Y", ImPlotAxisFlags_AutoFit, ImPlotAxisFlags_AutoFit);
|
||||
|
||||
ImPlot::PlotLine("##line", values.data(), values.size());
|
||||
|
||||
ImPlot::EndPlot();
|
||||
@@ -72,6 +71,7 @@ namespace hex::plugin::builtin {
|
||||
auto yPattern = arguments[1].toPattern();
|
||||
|
||||
if (ImPlot::BeginPlot("##plot", ImVec2(400, 250), ImPlotFlags_NoChild | ImPlotFlags_CanvasOnly)) {
|
||||
ImPlot::SetupAxes("X", "Y", ImPlotAxisFlags_AutoFit, ImPlotAxisFlags_AutoFit);
|
||||
|
||||
if (shouldReset) {
|
||||
xValues.clear(); yValues.clear();
|
||||
@@ -79,8 +79,6 @@ namespace hex::plugin::builtin {
|
||||
yValues = sampleData(patternToArray<float>(yPattern), ImPlot::GetPlotSize().x * 4);
|
||||
}
|
||||
|
||||
ImPlot::SetupAxes("X", "Y", ImPlotAxisFlags_AutoFit, ImPlotAxisFlags_AutoFit);
|
||||
|
||||
ImPlot::PlotScatter("##scatter", xValues.data(), yValues.data(), xValues.size());
|
||||
|
||||
ImPlot::EndPlot();
|
||||
|
||||
Reference in New Issue
Block a user