2016-11-14 22:12:43 +01:00
|
|
|
#include "path.h"
|
|
|
|
|
2017-06-29 22:29:27 +02:00
|
|
|
RectC Path::boundingRect() const
|
2017-03-18 01:30:31 +01:00
|
|
|
{
|
|
|
|
if (size() < 2)
|
2017-06-29 22:29:27 +02:00
|
|
|
return RectC();
|
2017-03-18 01:30:31 +01:00
|
|
|
|
2017-06-29 22:29:27 +02:00
|
|
|
RectC ret(first().coordinates(), first().coordinates());
|
|
|
|
for (int i = 1; i < size(); i++)
|
|
|
|
ret.unite(at(i).coordinates());
|
2017-03-18 01:30:31 +01:00
|
|
|
|
2017-06-29 22:29:27 +02:00
|
|
|
return ret;
|
2017-03-18 01:30:31 +01:00
|
|
|
}
|
|
|
|
|
2016-11-14 22:12:43 +01:00
|
|
|
QDebug operator<<(QDebug dbg, const PathPoint &point)
|
|
|
|
{
|
|
|
|
dbg.nospace() << "PathPoint(" << point.distance() << ", "
|
|
|
|
<< point.coordinates() << ")";
|
2017-08-15 15:13:34 +02:00
|
|
|
return dbg.space();
|
2016-11-14 22:12:43 +01:00
|
|
|
}
|