[Kst] kdeextragear-2/kst/kst

Barth Netterfield netterfield at astro.utoronto.ca
Tue Nov 23 19:25:20 CET 2004


CVS commit by netterfield: 

Label positions were being set by explicit number of pixels, which does not 
scale with plot size.  This changes positions to be relative to label size.

Please backport to 1.0.

BUG:


  M +3 -6      kst2dplot.cpp   1.300


--- kdeextragear-2/kst/kst/kst2dplot.cpp  #1.299:1.300
@@ -1732,5 +1732,5 @@ void Kst2DPlot::setBorders(double& xleft
   genAxisTickLabels(p, tpx, x_min, x_max, _xLog, XTickLabel, true);
   ybot_bdr_px  = tpx.maxHeight;
-  ybot_bdr_px += XLabel->lineSpacing(p) + 10;
+  ybot_bdr_px += 3*XLabel->lineSpacing(p)/2;
 
   //
@@ -1740,6 +1740,5 @@ void Kst2DPlot::setBorders(double& xleft
 
   xleft_bdr_px  = tpy.maxWidth;
-  xleft_bdr_px += YLabel->lineSpacing(p) + 10;
-
+  xleft_bdr_px += 3*YLabel->lineSpacing(p)/2;
   //
   // calculate the right border
@@ -2007,6 +2006,4 @@ void Kst2DPlot::draw(QPainter &p, KstPai
   p.setPen(QPen(_foregroundColor, penWidth));
 
-  //setTicks(XTick, Xorg, x_max, x_min, _xLog, true);
-  //setTicks(YTick, Yorg, y_max, y_min, _yLog, false);
   set2dPlotTickPix(xtick_len_px, ytick_len_px, x_px, y_px);
 
@@ -5755,5 +5752,5 @@ void Kst2DPlot::plotAxes(QPainter& p, QR
 void Kst2DPlot::plotLabels(QPainter &p, int x_px, int y_px, double xleft_bdr_px, double ytop_bdr_px) {
   XLabel->setResized();
-  XLabel->draw(p, x_px/2, y_px-(XLabel->lineSpacing(p) - XLabel->ascent(p))/2);
+  XLabel->draw(p, x_px/2, y_px-2*XLabel->ascent(p)/3);
 
   YLabel->setResized();





More information about the Kst mailing list