From 21958b48caca3423320f3e5e0e83096ca46b4d40 Mon Sep 17 00:00:00 2001 From: Bjoern Erik Nilsen Date: Wed, 29 Apr 2009 17:34:48 +0200 Subject: QTransform::map(const QRegion&) cut-off for single rect regions. Avoid QRegion<->QPainterPath conversion if possible. Reviewed-by: Samuel --- src/gui/painting/qtransform.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp index af27fd5..2383272 100644 --- a/src/gui/painting/qtransform.cpp +++ b/src/gui/painting/qtransform.cpp @@ -1317,12 +1317,16 @@ QRegion QTransform::map(const QRegion &r) const TransformationType t = type(); if (t == TxNone) return r; + if (t == TxTranslate) { QRegion copy(r); copy.translate(qRound(affine._dx), qRound(affine._dy)); return copy; } + if (t == TxScale && r.numRects() == 1) + return QRegion(mapRect(r.boundingRect())); + QPainterPath p = map(qt_regionToPath(r)); return p.toFillPolygon(QTransform()).toPolygon(); } -- cgit v0.12