2016-03-27 13:23:00 +02:00
|
|
|
#include "range.h"
|
|
|
|
|
|
|
|
void RangeF::resize(qreal size)
|
|
|
|
{
|
|
|
|
qreal adj = (size/2 - this->size()/2);
|
|
|
|
|
|
|
|
_min -= adj;
|
|
|
|
_max += adj;
|
|
|
|
}
|
|
|
|
|
2018-04-02 19:59:52 +02:00
|
|
|
RangeF RangeF::operator|(const RangeF &r) const
|
|
|
|
{
|
|
|
|
if (isNull())
|
|
|
|
return r;
|
|
|
|
if (r.isNull())
|
|
|
|
return *this;
|
|
|
|
return RangeF(qMax(this->_min, r._min), qMin(this->_max, r._max));
|
|
|
|
}
|
|
|
|
|
2018-02-13 23:03:18 +01:00
|
|
|
#ifndef QT_NO_DEBUG
|
2017-09-09 12:33:43 +02:00
|
|
|
QDebug operator<<(QDebug dbg, const Range &range)
|
|
|
|
{
|
|
|
|
dbg.nospace() << "Range(" << range.min() << ", " << range.max() << ")";
|
|
|
|
return dbg.space();
|
|
|
|
}
|
|
|
|
|
2016-03-27 13:23:00 +02:00
|
|
|
QDebug operator<<(QDebug dbg, const RangeF &range)
|
|
|
|
{
|
|
|
|
dbg.nospace() << "RangeF(" << range.min() << ", " << range.max() << ")";
|
2017-08-15 15:13:34 +02:00
|
|
|
return dbg.space();
|
2016-03-27 13:23:00 +02:00
|
|
|
}
|
2018-02-13 23:03:18 +01:00
|
|
|
#endif // QT_NO_DEBUG
|