1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-26 12:45:53 +01:00
GPXSee/src/common/range.cpp

33 lines
648 B
C++
Raw Normal View History

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));
}
#ifndef QT_NO_DEBUG
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
}
#endif // QT_NO_DEBUG