reformat Qt/qt_clust.cpp

This commit is contained in:
PatR
2020-12-27 17:01:33 -08:00
parent 7e20be61df
commit 953f0652c4
+6 -4
View File
@@ -20,14 +20,15 @@ static void include(QRect& r, const QRect& rect)
} }
/* /*
A Clusterizer groups rectangles (QRects) into non-overlapping rectangles * A Clusterizer groups rectangles (QRects) into non-overlapping
by a merging heuristic. * rectangles by a merging heuristic.
*/ */
Clusterizer::Clusterizer(int maxclusters) : Clusterizer::Clusterizer(int maxclusters) :
cluster(new QRect[maxclusters]), cluster(new QRect[maxclusters]),
count(0), count(0),
max(maxclusters) max(maxclusters)
{ } {
}
Clusterizer::~Clusterizer() Clusterizer::~Clusterizer()
{ {
@@ -51,7 +52,8 @@ void Clusterizer::add(int x, int y, int w, int h)
void Clusterizer::add(const QRect& rect) void Clusterizer::add(const QRect& rect)
{ {
QRect biggerrect(rect.x()-1,rect.y()-1,rect.width()+2,rect.height()+2); QRect biggerrect(rect.x() - 1, rect.y() - 1,
rect.width() + 2, rect.height() + 2);
//assert(rect.width() > 0 && rect.height() > 0); //assert(rect.width() > 0 && rect.height() > 0);