[Kst] kdeextragear-2/kst/kst
Andrew Walker
arwalker at sumusltd.com
Tue Nov 23 20:19:38 CET 2004
I'm not sure this is such a good idea.
If you're using large fonts for plotting
you end up with too much dead space.
If you think this is important then you
should scale to the plot size, not the label
size. Personally I though it worked well as
it was.
Andrew
-----Original Message-----
From: Barth Netterfield [mailto:netterfield at astro.utoronto.ca]
Sent: Tuesday, November 23, 2004 10:25 AM
To: kde-cvs at kde.org
Cc: kst at kde.org
Subject: [Kst] kdeextragear-2/kst/kst
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();
_______________________________________________
Kst mailing list
Kst at kde.org
https://mail.kde.org/mailman/listinfo/kst
More information about the Kst
mailing list