summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2009-06-16 12:55:13 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-06-16 12:55:13 (GMT)
commit33893addb13f80fe1decef325514853e695fe30c (patch)
tree678dd0d5d233e3f2e320a7126841655ad8a31b59 /src
parent9cb67d3db32423b4e624a8c1a7451a52ba242f54 (diff)
parentdf792f3f790e677552ea950b039d8f8e491180bf (diff)
downloadQt-33893addb13f80fe1decef325514853e695fe30c.zip
Qt-33893addb13f80fe1decef325514853e695fe30c.tar.gz
Qt-33893addb13f80fe1decef325514853e695fe30c.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src')
-rw-r--r--src/gui/painting/qtransform.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp
index 385fde1..7ca3b79 100644
--- a/src/gui/painting/qtransform.cpp
+++ b/src/gui/painting/qtransform.cpp
@@ -76,7 +76,9 @@ QT_BEGIN_NAMESPACE
nx = affine._m11 * FX_ + affine._m21 * FY_ + affine._dx; \
ny = affine._m12 * FX_ + affine._m22 * FY_ + affine._dy; \
if (t == TxProject) { \
- qreal w = 1./(m_13 * FX_ + m_23 * FY_ + m_33); \
+ qreal w = (m_13 * FX_ + m_23 * FY_ + m_33); \
+ if (w < Q_NEAR_CLIP) w = Q_NEAR_CLIP; \
+ w = 1./w; \
nx *= w; \
ny *= w; \
} \
@@ -1800,7 +1802,7 @@ QRect QTransform::mapRect(const QRect &rect) const
y -= h;
}
return QRect(x, y, w, h);
- } else if (t < TxProject) {
+ } else {
// see mapToPolygon for explanations of the algorithm.
qreal x = 0, y = 0;
MAP(rect.left(), rect.top(), x, y);
@@ -1824,10 +1826,6 @@ QRect QTransform::mapRect(const QRect &rect) const
xmax = qMax(xmax, x);
ymax = qMax(ymax, y);
return QRect(qRound(xmin), qRound(ymin), qRound(xmax)-qRound(xmin), qRound(ymax)-qRound(ymin));
- } else {
- QPainterPath path;
- path.addRect(rect);
- return map(path).boundingRect().toRect();
}
}
@@ -1870,7 +1868,7 @@ QRectF QTransform::mapRect(const QRectF &rect) const
y -= h;
}
return QRectF(x, y, w, h);
- } else if (t < TxProject) {
+ } else {
qreal x = 0, y = 0;
MAP(rect.x(), rect.y(), x, y);
qreal xmin = x;
@@ -1893,10 +1891,6 @@ QRectF QTransform::mapRect(const QRectF &rect) const
xmax = qMax(xmax, x);
ymax = qMax(ymax, y);
return QRectF(xmin, ymin, xmax-xmin, ymax - ymin);
- } else {
- QPainterPath path;
- path.addRect(rect);
- return map(path).boundingRect();
}
}