epezent / implot

Immediate Mode Plotting
MIT License
4.64k stars 516 forks source link

Custom plot size renders horizontal bars at the wrong location #427

Closed jgarvin closed 1 year ago

jgarvin commented 1 year ago

If you call ImPlot::BeginPlot("foo", ImVec2(-1, 1000)) to get a PlotBarsHG with more vertical size than normal, the y-axis tick marks appear at the correct locations, but the bars no longer rendered centered on them. See attached screenshot.

Screenshot from 2022-11-28 15-02-14

The callback for PlotBarsHG always takes the index passed into it and uses it for the X value, so the bar should always be centered exactly on the tick mark.

jgarvin commented 1 year ago

Oops nevermind, user error, thought I'd ruled something out that I hadn't :P