diff options
author | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-07-29 02:56:22 (GMT) |
---|---|---|
committer | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-07-29 06:43:34 (GMT) |
commit | 1cff081464744774d9d3e76704c03209fca280c2 (patch) | |
tree | 6811faac0d75f4fc75c970ec95f60034a0a0d0ab /src/gui/graphicsview/qgraphicsitem.cpp | |
parent | f0ed432d55ef6da7223ee3d58e45391e3f88be86 (diff) | |
download | Qt-1cff081464744774d9d3e76704c03209fca280c2.zip Qt-1cff081464744774d9d3e76704c03209fca280c2.tar.gz Qt-1cff081464744774d9d3e76704c03209fca280c2.tar.bz2 |
Add new enum to global namespace: Qt::CoordinateSystem
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index c0fa271..bb3258d 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -9926,11 +9926,11 @@ int QGraphicsItemGroup::type() const return Type; } -QRectF QGraphicsItemEffectSourcePrivate::boundingRect(bool deviceCoordinates) const +QRectF QGraphicsItemEffectSourcePrivate::boundingRect(Qt::CoordinateSystem system) const { QRectF rect = item->boundingRect(); rect |= item->childrenBoundingRect(); - if (deviceCoordinates && info) { + if (info && system == Qt::DeviceCoordinates) { Q_ASSERT(info->transformPtr); return info->transformPtr->mapRect(rect); } @@ -9954,15 +9954,16 @@ void QGraphicsItemEffectSourcePrivate::draw(QPainter *painter) } } -QPixmap QGraphicsItemEffectSourcePrivate::pixmap(bool deviceCoordinates, QPoint *offset) const +QPixmap QGraphicsItemEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QPoint *offset) const { - const QRectF sourceRect = boundingRect(deviceCoordinates); + const QRectF sourceRect = boundingRect(system); const QRect effectRect = item->graphicsEffect()->boundingRectFor(sourceRect).toAlignedRect(); if (offset) *offset = sourceRect.toAlignedRect().topLeft(); const QTransform translateTransform = QTransform::fromTranslate(-effectRect.x(), -effectRect.y()); + const bool deviceCoordinates = (system == Qt::DeviceCoordinates); QTransform effectTransform = deviceCoordinates ? translateTransform : info->transformPtr->inverted(); if (!deviceCoordinates) |