[Kst] kdeextragear-2/kst/kst
George Staikos
staikos at kde.org
Mon Dec 13 08:56:40 CET 2004
CVS commit by staikos:
make the geometry of the label closer to correct
M +17 -17 kstlabel.cpp 1.51
--- kdeextragear-2/kst/kst/kstlabel.cpp #1.50:1.51
@@ -369,12 +369,12 @@ void KstLabel::draw(QPainter &p, int px,
QSize sz = p.fontMetrics().size(Qt::AlignLeft|Qt::AlignVCenter|Qt::ExpandTabs, strOut, -1, tabWidth);
if (doDraw) {
- p.drawText(int(x),int(y) - sz.height() - fP[i_fp].dy, sz.width(), sz.height(), Qt::AlignLeft|Qt::AlignVCenter|Qt::ExpandTabs, strOut);
+ p.drawText(int(x), int(y) - sz.height() - fP[i_fp].dy, sz.width(), sz.height(), Qt::AlignLeft|Qt::AlignVCenter|Qt::ExpandTabs, strOut);
}
x += sz.width();
- if (y + fP[i_fp].dy - (double)p.fontMetrics().ascent() < y_upper) {
- y_upper = y + fP[i_fp].dy - (double)p.fontMetrics().ascent();
+ if (y - fP[i_fp].dy - sz.height() < y_upper) {
+ y_upper = y - fP[i_fp].dy - sz.height();
}
- if (y + fP[i_fp].dy + (double)p.fontMetrics().descent() > y_lower) {
- y_lower = y + fP[i_fp].dy + (double)p.fontMetrics().descent();
+ if (y + fP[i_fp].dy > y_lower) {
+ y_lower = y + fP[i_fp].dy;
}
strOut = QString::null;
@@ -465,9 +465,9 @@ void KstLabel::draw(QPainter &p, int px,
x += sz.width();
- if (y + fP[i_fp].dy - (double)p.fontMetrics().ascent() < y_upper) {
- y_upper = y + fP[i_fp].dy - (double)p.fontMetrics().ascent();
+ if (y - fP[i_fp].dy - sz.height() < y_upper) {
+ y_upper = y - fP[i_fp].dy - sz.height();
}
- if (y + fP[i_fp].dy + (double)p.fontMetrics().descent() > y_lower) {
- y_lower = y + fP[i_fp].dy + (double)p.fontMetrics().descent();
+ if (y + fP[i_fp].dy > y_lower) {
+ y_lower = y + fP[i_fp].dy;
}
} else {
@@ -523,9 +523,9 @@ void KstLabel::draw(QPainter &p, int px,
}
x += sz.width();
- if (y + fP[i_fp].dy - (double)p.fontMetrics().ascent() < y_upper) {
- y_upper = y + fP[i_fp].dy - (double)p.fontMetrics().ascent();
+ if (y - fP[i_fp].dy - sz.height() < y_upper) {
+ y_upper = y - fP[i_fp].dy - sz.height();
}
- if (y + fP[i_fp].dy + (double)p.fontMetrics().descent() > y_lower) {
- y_lower = y + fP[i_fp].dy + (double)p.fontMetrics().descent();
+ if (y + fP[i_fp].dy > y_lower) {
+ y_lower = y + fP[i_fp].dy;
}
strOut = QString::null;
@@ -552,9 +552,9 @@ void KstLabel::draw(QPainter &p, int px,
x += sz.width();
- if (y + fP[i_fp].dy - (double)p.fontMetrics().ascent() < y_upper) {
- y_upper = y + fP[i_fp].dy - (double)p.fontMetrics().ascent();
+ if (y - fP[i_fp].dy - sz.height() < y_upper) {
+ y_upper = y - fP[i_fp].dy - sz.height();
}
- if (y + fP[i_fp].dy + (double)p.fontMetrics().descent() > y_lower) {
- y_lower = y + fP[i_fp].dy + (double)p.fontMetrics().descent();
+ if (y + fP[i_fp].dy > y_lower) {
+ y_lower = y + fP[i_fp].dy;
}
}
More information about the Kst
mailing list