summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qrasterizer.cpp
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2009-09-09 13:45:11 +1000
committerRohan McGovern <rohan.mcgovern@nokia.com>2009-09-09 13:45:11 +1000
commit8d37cc2a85f6aa1b9ca3ddc3a923befb4434c62c (patch)
tree98652a86fe2125ccb7a7c194b1e1da205f9eb79d /src/gui/painting/qrasterizer.cpp
parent39bcbc8df52eb5df5f7e39dc4265c8a77d3881be (diff)
parent4feb4019cfc144cef4cd9177d52e52dee9ebdf32 (diff)
Merge commit '4feb4019cfc144cef4cd9177d52e52dee9ebdf32' into 4.6
Conflicts: tests/auto/network-settings.h tests/auto/qpainter/tst_qpainter.cpp
Diffstat (limited to 'src/gui/painting/qrasterizer.cpp')
-rw-r--r--src/gui/painting/qrasterizer.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp
index 2b73f9b1bb..78b0877931 100644
--- a/src/gui/painting/qrasterizer.cpp
+++ b/src/gui/painting/qrasterizer.cpp
@@ -692,14 +692,14 @@ static inline bool q16Dot16Compare(qreal p1, qreal p2)
return FloatToQ16Dot16(p2 - p1) == 0;
}
-static inline qreal qRoundF(qreal v)
+static inline qreal qFloorF(qreal v)
{
#ifdef QT_USE_MATH_H_FLOATS
if (sizeof(qreal) == sizeof(float))
- return floorf(v + 0.5);
+ return floorf(v);
else
#endif
- return floor(v + 0.5);
+ return floor(v);
}
void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width, bool squareCap)
@@ -759,10 +759,10 @@ void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width,
const qreal reciprocal = 1 / gridResolution;
// snap to grid to prevent large slopes
- pa.rx() = qRoundF(pa.rx() * gridResolution) * reciprocal;
- pa.ry() = qRoundF(pa.ry() * gridResolution) * reciprocal;
- pb.rx() = qRoundF(pb.rx() * gridResolution) * reciprocal;
- pb.ry() = qRoundF(pb.ry() * gridResolution) * reciprocal;
+ pa.rx() = qFloorF(pa.rx() * gridResolution) * reciprocal;
+ pa.ry() = qFloorF(pa.ry() * gridResolution) * reciprocal;
+ pb.rx() = qFloorF(pb.rx() * gridResolution) * reciprocal;
+ pb.ry() = qFloorF(pb.ry() * gridResolution) * reciprocal;
// old delta
const QPointF d0 = a - b;