X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;ds=sidebyside;f=libctgraphics%2Fezplot.cpp;h=fb823b505f15feb1c7f0bbdee9ec052fab08190b;hb=bfcc769cf8019eabc8c65c07257c8dbee4b4c977;hp=c29575737f47870ca14c934b2c7e218b8236405e;hpb=a05f3cb550877e94aa118cc04b361c0c8fdb3dc3;p=ctsim.git diff --git a/libctgraphics/ezplot.cpp b/libctgraphics/ezplot.cpp index c295757..fb823b5 100644 --- a/libctgraphics/ezplot.cpp +++ b/libctgraphics/ezplot.cpp @@ -6,7 +6,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: ezplot.cpp,v 1.12 2000/08/31 08:38:58 kevin Exp $ +** $Id: ezplot.cpp,v 1.13 2000/09/02 05:10:39 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 @@ -333,7 +333,7 @@ EZPlot::plot () /* adjust frame for title */ if (c_title.length() > 0) ya_max -= 2.5 * charheight; - title_row = ya_max + 0.5 * charheight; + title_row = ya_max + charheight; /* calculate legend box boundaries */ int max_leg = 0; /* longest legend in characters */ @@ -587,7 +587,9 @@ EZPlot::drawAxes(void) rSGP.setViewport (xp_min, yp_min, xp_max, yp_max); if (c_title.length() > 0) { - rSGP.moveAbs (xa_min + (xa_max-xa_min)/2 - c_title.length()*charwidth, title_row); + double wText, hText; + rSGP.getTextExtent (c_title.c_str(), &wText, &hText); + rSGP.moveAbs (xa_min + (xa_max-xa_min)/2 - wText/2, title_row); rSGP.setTextSize (charheight * 2.0); rSGP.setTextColor (clr_title, -1); rSGP.drawText (c_title);