[Kst] kdeextragear-2/kst/kst
Andrew Walker
arwalker at sumusltd.com
Wed Dec 22 19:01:33 CET 2004
CVS commit by arwalker:
Remove some unnecessary calculations.
Fix problem with line position for overlapping (i.e. located at same pixel on x-axis) data points.
M +14 -6 kst2dplot.cpp 1.339
--- kdeextragear-2/kst/kst/kst2dplot.cpp #1.338:1.339
@@ -1834,5 +1834,5 @@ void Kst2DPlot::drawDotAt(QPainter& p, d
p.setRasterOp(Qt::XorROP);
p.setPen(QPen(colorOuter, 1));
- p.drawEllipse(d2i(X1) - 3, d2i(Y1) - 3, 6, 6);
+ p.drawEllipse(X1 - 3, Y1 - 3, 6, 6);
p.setRasterOp(Qt::CopyROP);
}
@@ -5264,5 +5264,5 @@ void Kst2DPlot::plotCurves(QPainter& p,
if (!foundNan) {
- if (floor(X1) == floor(X2)) {
+ if (d2i(X1) == d2i(X2)) {
if (overlap) {
if (Y1 > maxY) {
@@ -5291,5 +5291,9 @@ void Kst2DPlot::plotCurves(QPainter& p,
p.drawLine(d2i(X2), d2i(minY), d2i(X2), d2i(maxY));
} else {
- int X2i = d2i(X2), maxYi = d2i(maxY), minYi = d2i(minY), Y2i = d2i(Y2);
+ int X2i = d2i(X2);
+ int Y2i = d2i(Y2);
+ int maxYi = d2i(maxY);
+ int minYi = d2i(minY);
+
if (index >= MAX_NUM_POLYLINES-2) {
p.drawPolyline(points, 0, index);
@@ -5401,10 +5405,14 @@ void Kst2DPlot::plotCurves(QPainter& p,
}
- int X1i = d2i(X1), Y1i = d2i(Y1), X2i = d2i(X2), Y2i = d2i(Y2);
if (X1 >= Lx && X1 <= Hx && X2 >= Lx && X2 <= Hx &&
Y1 >= Ly && Y1 <= Hy && Y2 >= Ly && Y2 <= Hy) {
if (style == Qt::SolidLine) {
- p.drawLine(X1i, Y1i, X2i, Y2i);
+ p.drawLine(d2i(X1), d2i(Y1), d2i(X2), d2i(Y2));
} else {
+ int X1i = d2i(X1);
+ int Y1i = d2i(Y1);
+ int X2i = d2i(X2);
+ int Y2i = d2i(Y2);
+
if (index == 0) {
points.setPoint(index++, X2i, Y2i);
More information about the Kst
mailing list