** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: ezplot.cpp,v 1.27 2001/01/02 09:58:11 kevin Exp $
+** $Id: ezplot.cpp,v 1.29 2001/01/12 16:41:56 kevin Exp $
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
if (o_yaxis == NOAXIS || o_ytlabel == FALSE)
ytl_ofs = 0.0;
else if (o_yticks == LEFT) {
- double xExtent, yExtent;
+ double xExtentMin, xExtentMax, yExtent;
char s[1024];
- snprintf (s, sizeof(s), y_numfmt, 0);
- m_pSGP->getTextExtent (s, &xExtent, &yExtent);
- ytl_ofs = -2.0 * charwidth - xExtent;
+ snprintf (s, sizeof(s), y_numfmt, ymin);
+ m_pSGP->getTextExtent (s, &xExtentMin, &yExtent);
+ snprintf (s, sizeof(s), y_numfmt, ymax);
+ m_pSGP->getTextExtent (s, &xExtentMax, &yExtent);
+ if (xExtentMin > xExtentMax)
+ xExtentMax = xExtentMin;
+ ytl_ofs = -xExtentMax;
} else if (o_yticks == RIGHT)
ytl_ofs = 1.5 * charwidth;
xa_max -= 0.7 * x_fldwid * charwidth; // make room for last x tick label
-
-
xt_min = xa_min;
yt_min = ya_min;
xt_max = xa_max;
if (ytl_ofs != 0.0 && s_xcross == FALSE) {
if (o_yticks == LEFT) {
- xa_min += (2 + y_fldwid) * charwidth;
+ xa_min += 2*charwidth - ytl_ofs; // (2 + y_fldwid) * charwidth;
xt_min = xa_min;
} else if (o_yticks == RIGHT) {
xa_min += 0.0;
- xt_min = xa_min + ytl_ofs + y_fldwid * charwidth;
+ xt_min = xa_min + ytl_ofs; // + y_fldwid * charwidth;
}
} else
xt_min = xa_min;
}
}
}
- }
-
+ }
}