Mercurial > octave-nkf
changeset 7843:d3dcfdfdc434
handle unsorted limits when calculatin gticks and limits
author | Shai Ayal <shaiay@users.sourceforge.net> |
---|---|
date | Mon, 25 Feb 2008 21:50:37 +0200 |
parents | 1357bcae6e29 |
children | 3d60445d3638 |
files | src/ChangeLog src/graphics.cc |
diffstat | 2 files changed, 10 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog Mon Feb 25 21:45:11 2008 +0200 +++ b/src/ChangeLog Mon Feb 25 21:50:37 2008 +0200 @@ -1,5 +1,8 @@ 2008-06-04 Shai Ayal <shaiay@users.sourceforge.net> + * graphics.cc (axes::properties::calc_ticks_and_lims): Make sure + that lo <= hi. + * graphics.h.in (axes::pixel2coord, axes::coord2pixel): New functions. * graphics.cc (convert_position): No longer static.
--- a/src/graphics.cc Mon Feb 25 21:45:11 2008 +0200 +++ b/src/graphics.cc Mon Feb 25 21:50:37 2008 +0200 @@ -2607,6 +2607,13 @@ double lo = (lims.get ().matrix_value ()) (0); double hi = (lims.get ().matrix_value ()) (1); + // FIXME should this be checked for somewhere else? (i.e. set{x,y,z}lim) + if (hi < lo) + { + double tmp = hi; + hi = lo; + lo = tmp; + } double tick_sep = calc_tick_sep (lo , hi);