epezent / implot

Immediate Mode Plotting
MIT License
4.84k stars 531 forks source link

Cannot scroll/zoom primary axis when linked to secondary #544

Open Nahor opened 11 months ago

Nahor commented 11 months ago

version: v0.16 branch: master

When the primary and secondary axis are linked, I can scroll/zoom using the plot area or the secondary axis. But if I do it over the primary axis, the limits are forced back to the original ones.

https://github.com/epezent/implot/assets/1198364/35b655c5-a984-4397-b2a9-adf5f144c1f1

if (ImPlot::BeginPlot("LinkTest")) {
    ImPlot::SetupAxis(ImAxis_X2, nullptr, ImPlotAxisFlags_AuxDefault);

    static ImPlotRange link{0.0, 1.0};
    ImPlot::SetupAxisLinks(ImAxis_X1, &link.Min, &link.Max);
    ImPlot::SetupAxisLinks(ImAxis_X2, &link.Min, &link.Max);

    ImPlot::EndPlot();
}