1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-10-07 07:13:21 +02:00
GPXSee/src/map/textitem.cpp

18 lines
372 B
C++
Raw Normal View History

#include "textitem.h"
bool TextItem::collides(const QList<TextItem*> &list) const
{
QRectF r1(boundingRect());
for (int i = 0; i < list.size(); i++) {
const TextItem* other = list.at(i);
QRectF r2(other->boundingRect());
if (!(r1.isEmpty() || r2.isEmpty() || !r1.intersects(r2)))
if (other->shape().intersects(shape()))
return true;
}
return false;
}