From: Ethan A M. <me...@uw...> - 2020-09-12 05:52:22
|
On Friday, 11 September 2020 20:13:33 PDT Dima Kogan wrote: > In any case, this worked in 5.2. I just did a bisection, and I can now > see why this seemed familiar. The commit that broke it: > > https://sourceforge.net/p/gnuplot/gnuplot-main/ci/36a2407e50/ > > The person who broke it was me! But despite what git says, I have very > little recollection of any of this. Ethan: do you have a good sense of > what's happening here, and can you easily fix it now? If not, I can poke > at it, and figure it out. > > dima I am puzzled because I do not understand the difference between returning to the top level zoom state by pressing 'p' to step backwards through the stack of zoom operations and pressing 'u' to jump back to the top of the stack. Either way it should be applying the same state (confirmed in the debugger) but for some reason that I don't understand the former works correcly and the latter doesn't. I _think_ that the problem involves this macro in axis.h %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /* Simplest form of autoscaling (no check on autoscale constraints). * Used by refresh_bounds() and refresh_3dbounds(). * Used also by autoscale_boxplot. */ #define autoscale_one_point(axis, x) do {\ if (axis->set_autoscale & AUTOSCALE_MIN && x < axis->min) \ axis->min = x; \ if (axis->set_autoscale & AUTOSCALE_MAX && x > axis->max) \ axis->max = x; \ } while (0); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% as called from plot2d.c:refresh_bounds() when zooming volatile data. Note that the macro does not consider the case of reversed axes. Adding a test for (axis->min < axis->max) seems to make your test case work. See attached patch. The unpatched code does the wrong thing for reversed axes. The patched code does nothing at all for reversed axes, is it probably wrong also but for some case other than yours. A more complete fix for the macro is wanted. And even after tracking it that far I still don't understand why 'p' works and 'u' doesn't. If you can figure that out I'd be happier with declaring it fixed. Ethan -- Ethan A Merritt Biomolecular Structure Center, K-428 Health Sciences Bldg MS 357742, University of Washington, Seattle 98195-7742 |