From e692a4044e161c46e6b145d2f3874a0b7b929b4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 26 Aug 2009 10:29:11 +0200 Subject: Fixed clipping bug in GL 2 paint engine (visible in arthur demos). QVectorPath::hints() is not a strict bit field, and thus can not be anded with RectangleHint. Instead, QVectorPath::shape() should be directly compared with RectangleHint to check if the vector path is a rectangle or not. In this case the first four points of a regular painter path were treated as a rectangle with dire consequences. Reviewed-by: Tom --- src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 2901c1e..136a078 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1499,7 +1499,7 @@ void QGL2PaintEngineEx::clip(const QVectorPath &path, Qt::ClipOperation op) if (op == Qt::ReplaceClip && !d->hasClipOperations()) op = Qt::IntersectClip; - if (!path.isEmpty() && op == Qt::IntersectClip && (path.hints() & QVectorPath::RectangleHint)) { + if (!path.isEmpty() && op == Qt::IntersectClip && (path.shape() == QVectorPath::RectangleHint)) { const QPointF* const points = reinterpret_cast(path.points()); QRectF rect(points[0], points[2]); -- cgit v0.12