epezent / implot

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

SetupAxisLimits' secret #448

Closed nuuSolutions closed 1 year ago

nuuSolutions commented 1 year ago

SetupAxisLimits 'secretly' switches min and max if they are not 'in order'.

Expected behaviour: Plotting something with AxisLimits +1 to -1 instead of -1 to +1 (or [b..a] instead of [a..b]) will visually reverse the plot and show the correct i.e. inverted Axis ticks etc.

epezent commented 1 year ago

we have ImPlotAxisFlags_Invert to do what you want. additionally supporting inversion through unintended usage of SetupAxisLimits just complicates the code, hence the "secret". that said, this should be documented better so I will put a comment about this in the header. thanks for flagging.