diff options
| author | manuel <manuel@mausz.at> | 2011-04-09 12:34:06 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2011-04-09 12:34:06 +0200 |
| commit | 7e4bc8ece49543533c4e27f5d6bc867c1bada601 (patch) | |
| tree | 261881edeed4c703c9f1fce5111705a013df8bdc /pacman-c++/pixmapitem.cpp | |
| parent | a4fc700dfe22c252824ac81711da4bd0bf94def5 (diff) | |
| download | foop-7e4bc8ece49543533c4e27f5d6bc867c1bada601.tar.gz foop-7e4bc8ece49543533c4e27f5d6bc867c1bada601.tar.bz2 foop-7e4bc8ece49543533c4e27f5d6bc867c1bada601.zip | |
collision detection fix
Diffstat (limited to 'pacman-c++/pixmapitem.cpp')
| -rw-r--r-- | pacman-c++/pixmapitem.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pacman-c++/pixmapitem.cpp b/pacman-c++/pixmapitem.cpp index 84517c2..1ceeec1 100644 --- a/pacman-c++/pixmapitem.cpp +++ b/pacman-c++/pixmapitem.cpp | |||
| @@ -63,6 +63,13 @@ QRectF PixmapItem::boundingRect() const | |||
| 63 | return QRectF(QPointF(0, 0), size()); | 63 | return QRectF(QPointF(0, 0), size()); |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | QPainterPath PixmapItem::shape() const | ||
| 67 | { | ||
| 68 | QPainterPath path; | ||
| 69 | path.addRect(boundingRect()); | ||
| 70 | return path; | ||
| 71 | } | ||
| 72 | |||
| 66 | void PixmapItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) | 73 | void PixmapItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) |
| 67 | { | 74 | { |
| 68 | painter->drawPixmap(QPoint(0, 0), m_pix, QRect(m_x, m_y, m_width, m_height)); | 75 | painter->drawPixmap(QPoint(0, 0), m_pix, QRect(m_x, m_y, m_width, m_height)); |
