From 2a52786e04fac57aba89846694135da330b8e9b3 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 23 May 2009 00:52:21 -0400 Subject: Better detection of collision --- sigmodr/widgets/mapeditor/WorldMapItem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit