diff options
author | Ben Boeckel <MathStuf@gmail.com> | 2009-05-23 00:52:21 -0400 |
---|---|---|
committer | Ben Boeckel <MathStuf@gmail.com> | 2009-05-23 00:52:21 -0400 |
commit | 2a52786e04fac57aba89846694135da330b8e9b3 (patch) | |
tree | 064061175840a0e3bc7c67b3dccd1d920966be66 | |
parent | 9a976e80bda39289d2e1f9b7f7d7740a9f03b358 (diff) | |
download | sigen-2a52786e04fac57aba89846694135da330b8e9b3.tar.gz sigen-2a52786e04fac57aba89846694135da330b8e9b3.tar.xz sigen-2a52786e04fac57aba89846694135da330b8e9b3.zip |
Better detection of collision
-rw-r--r-- | sigmodr/widgets/mapeditor/WorldMapItem.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sigmodr/widgets/mapeditor/WorldMapItem.cpp b/sigmodr/widgets/mapeditor/WorldMapItem.cpp index ef1f6e1b..6dceaed3 100644 --- a/sigmodr/widgets/mapeditor/WorldMapItem.cpp +++ b/sigmodr/widgets/mapeditor/WorldMapItem.cpp @@ -95,7 +95,7 @@ bool WorldMapItem::collidesWithItem(const QGraphicsItem* other, Qt::ItemSelectio return false; const QRectF rect = QRectF(scenePos(), QPointF(m_map->width(), m_map->height())).adjusted(1, 1, -1, -1); const QRectF otherRect(item->scenePos(), QPointF(item->m_map->width(), item->m_map->height())); - return rect.intersects(otherRect); + return !rect.intersected(otherRect).isNull(); } int WorldMapItem::type() const |