MCPcopy Create free account
hub / github.com/LUX-Core/lux / bounded

Method bounded

src/qt/qcustomplot.cpp:1998–2019  ·  view source on GitHub ↗

! Returns this range, possibly modified to not exceed the bounds provided as \a lowerBound and \a upperBound. If possible, the size of the current range is preserved in the process. If the range shall only be bounded at the lower side, you can set \a upperBound to \ref QCPRange::maxRange. If it shall only be bounded at the upper side, set \a lowerBound to -\ref QCPRange::maxRange. */

Source from the content-addressed store, hash-verified

1996 QCPRange::maxRange.
1997*/
1998QCPRange QCPRange::bounded(double lowerBound, double upperBound) const
1999{
2000 if (lowerBound > upperBound)
2001 qSwap(lowerBound, upperBound);
2002
2003 QCPRange result(lower, upper);
2004 if (result.lower < lowerBound)
2005 {
2006 result.lower = lowerBound;
2007 result.upper = lowerBound + size();
2008 if (result.upper > upperBound || qFuzzyCompare(size(), upperBound-lowerBound))
2009 result.upper = upperBound;
2010 } else if (result.upper > upperBound)
2011 {
2012 result.upper = upperBound;
2013 result.lower = upperBound - size();
2014 if (result.lower < lowerBound || qFuzzyCompare(size(), upperBound-lowerBound))
2015 result.lower = lowerBound;
2016 }
2017
2018 return result;
2019}
2020
2021/*!
2022 Returns a sanitized version of the range. Sanitized means for logarithmic scales, that

Callers 2

getVisibleDataBoundsMethod · 0.80

Calls 2

sizeFunction · 0.85
isEmptyMethod · 0.45

Tested by

no test coverage detected