Mercurial > octave-nkf
diff libinterp/corefcn/graphics.cc @ 20323:494a5ed628b5
Fix segfault when zooming in on logscale axes (bug #45412).
* graphics.cc (axes::properties::calc_ticks_and_lims): When adjusting ticks to
to fit within existing manual limits, make sure that upper tick remains greater
than or equal to lower tick.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 26 Jun 2015 08:37:45 -0700 |
parents | 6db2ea5556a4 |
children | 564e59f75ef8 |
line wrap: on
line diff
--- a/libinterp/corefcn/graphics.cc Thu Jun 25 21:47:06 2015 -0700 +++ b/libinterp/corefcn/graphics.cc Fri Jun 26 08:37:45 2015 -0700 @@ -7114,7 +7114,7 @@ if (limmode_is_auto) { - // Adjust limits to include min and max tics + // Adjust limits to include min and max ticks Matrix tmp_lims (1,2); tmp_lims(0) = std::min (tick_sep * i1, lo); tmp_lims(1) = std::max (tick_sep * i2, hi); @@ -7136,10 +7136,10 @@ } else { - // adjust min and max tics to be within limits + // adjust min and max ticks to be within limits if (i1*tick_sep < lo) i1++; - if (i2*tick_sep > hi) + if (i2*tick_sep > hi && i2 > i1) i2--; }