[Kst] extragear/graphics/kst/kst
Barth Netterfield
netterfield at astro.utoronto.ca
Wed Oct 19 22:12:24 CEST 2005
SVN commit 472090 by netterfield:
Move plotlabel size updates to InternalAlignment which happens first.
Label alignment in printing works again in common cases...
M +10 -13 kst2dplot.cpp
--- trunk/extragear/graphics/kst/kst/kst2dplot.cpp #472089:472090
@@ -60,8 +60,6 @@
#include "kstvectordialog_i.h"
#include "plotmimesource.h"
-#define MIN_FONT_SIZE 5
-
#define INVALIDPLOTPOINT -1
#define JD1900 2415020.5
#define JD1970 2440587.5
@@ -1831,9 +1829,17 @@
int x_px, y_px;
+ // resize labels based on window size.
+ x_px = geometry().width();
+ y_px = geometry().height();
+ _xLabel->updateAbsFontSize(x_px, y_px);
+ _yLabel->updateAbsFontSize(x_px, y_px);
+ _topLabel->updateAbsFontSize(x_px, y_px);
+ _tickLabel->updateAbsFontSize(x_px, y_px);
+
x_px = p.window().width();
y_px = p.window().height();
-
+
p.save();
p.setWindow(0, 0, size().width(), size().height());
updateScale();
@@ -2179,7 +2185,6 @@
if (_zoomPaused) {
return;
}
- //kstdDebug() << type << "paint 2dplot\n";
// check for optimizations
QSize sizeNew = size();
QRect alignment = KST::alignment.limits(geometry());
@@ -2303,12 +2308,6 @@
x_px = p.window().width();
y_px = p.window().height();
- // resize labels based on window size.
- _xLabel->updateAbsFontSize(x_px, y_px);
- _yLabel->updateAbsFontSize(x_px, y_px);
- _topLabel->updateAbsFontSize(x_px, y_px);
- _tickLabel->updateAbsFontSize(x_px, y_px);
-
if (type != P_PRINT && type != P_EXPORT) {
updateScale();
}
@@ -2570,7 +2569,6 @@
setDirty(false);
KstObject::UpdateType update_state;
- printf("-----------------------updating 2dplot: %d\n", update_counter);
if (KstObject::checkUpdateCounter(update_counter) && !force) {
return lastUpdateResult();
}
@@ -2585,7 +2583,6 @@
cp->writeUnlock();
}
- printf("------------------------updating children: %d\n", update_counter);
update_state = updateChildren(update_counter);
updated = (UPDATE == KstPlotBase::update(update_counter)) || updated;
@@ -5783,7 +5780,7 @@
} else {
p.translate(xleft_bdr_px, d2i(0.08*_topLabel->size().height()));
}
- //printf("ls: %d height: %d fs: %d\n", _topLabel->lineSpacing(), _topLabel->size().height(), _topLabel->absFontSize());
+
_topLabel->paint(p);
p.restore();
}
More information about the Kst
mailing list