diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2009-12-11 11:21:49 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2009-12-14 14:18:35 (GMT) |
commit | 8bbb0e70d189d7027494004a8dece8aeb4e37366 (patch) | |
tree | e906f80246ce27552632beaf281e52c977b1ac3b /src/gui/effects | |
parent | be525c78c8ac44e7c188a45a4e04a1d80ad9ba51 (diff) | |
download | Qt-8bbb0e70d189d7027494004a8dece8aeb4e37366.zip Qt-8bbb0e70d189d7027494004a8dece8aeb4e37366.tar.gz Qt-8bbb0e70d189d7027494004a8dece8aeb4e37366.tar.bz2 |
Fixed bug in QGraphicsPixmapItem shortcut for graphics effects.
We need to take the pixmap item's drawing offset into consideration.
Reviewed-by: Bjørn Erik Nilsen
Diffstat (limited to 'src/gui/effects')
-rw-r--r-- | src/gui/effects/qgraphicseffect.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp index d6cabaa..4f7ffc8 100644 --- a/src/gui/effects/qgraphicseffect.cpp +++ b/src/gui/effects/qgraphicseffect.cpp @@ -313,7 +313,10 @@ QPixmap QGraphicsEffectSource::pixmap(Qt::CoordinateSystem system, QPoint *offse // Shortcut, no cache for childless pixmap items... const QGraphicsItem *item = graphicsItem(); if (system == Qt::LogicalCoordinates && mode == QGraphicsEffect::NoPad && item && isPixmap()) { - return ((QGraphicsPixmapItem *) item)->pixmap(); + const QGraphicsPixmapItem *pixmapItem = static_cast<const QGraphicsPixmapItem *>(item); + if (offset) + *offset = pixmapItem->offset().toPoint(); + return pixmapItem->pixmap(); } if (system == Qt::DeviceCoordinates && item |