QskIntervalF::width -> QskIntervalF::length
This commit is contained in:
parent
7197c89533
commit
3c505652a3
@ -66,7 +66,7 @@ QskIntervalF StackedChart::stackedInterval( int index ) const
|
||||
if ( index >= 0 && index < m_data->samples.size() )
|
||||
{
|
||||
interval.setLowerBound( m_data->cumulatedValues[index] );
|
||||
interval.setWidth( m_data->samples[index].value() );
|
||||
interval.setLength( m_data->samples[index].value() );
|
||||
}
|
||||
|
||||
return interval;
|
||||
|
@ -37,10 +37,10 @@ namespace Engine
|
||||
if ( !interval.isValid() )
|
||||
return false;
|
||||
|
||||
if ( fuzzyCompare( value, interval.lowerBound(), interval.width() ) < 0 )
|
||||
if ( fuzzyCompare( value, interval.lowerBound(), interval.length() ) < 0 )
|
||||
return false;
|
||||
|
||||
if ( fuzzyCompare( value, interval.upperBound(), interval.width() ) > 0 )
|
||||
if ( fuzzyCompare( value, interval.upperBound(), interval.length() ) > 0 )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@ -94,7 +94,7 @@ namespace Engine
|
||||
QVector< qreal > buildMajorTicks(
|
||||
const QskIntervalF& interval, qreal stepSize )
|
||||
{
|
||||
int numTicks = qRound( interval.width() / stepSize ) + 1;
|
||||
int numTicks = qRound( interval.length() / stepSize ) + 1;
|
||||
if ( numTicks > 10000 )
|
||||
numTicks = 10000;
|
||||
|
||||
@ -187,13 +187,13 @@ QskTickmarks QskGraduation::divideInterval(
|
||||
|
||||
const auto interval = QskIntervalF::normalized( x1, x2 );
|
||||
|
||||
if ( interval.width() > std::numeric_limits< qreal >::max() )
|
||||
if ( interval.length() > std::numeric_limits< qreal >::max() )
|
||||
{
|
||||
qWarning() << "QskGraduation::divideInterval: overflow";
|
||||
return tickmarks;
|
||||
}
|
||||
|
||||
if ( interval.width() <= 0.0 || stepSize < 0.0 )
|
||||
if ( interval.length() <= 0.0 || stepSize < 0.0 )
|
||||
return tickmarks;
|
||||
|
||||
if ( stepSize == 0.0 )
|
||||
@ -201,7 +201,7 @@ QskTickmarks QskGraduation::divideInterval(
|
||||
if ( maxMajorSteps < 1 )
|
||||
maxMajorSteps = 1;
|
||||
|
||||
stepSize = QskGraduation::stepSize( interval.width(), maxMajorSteps );
|
||||
stepSize = QskGraduation::stepSize( interval.length(), maxMajorSteps );
|
||||
}
|
||||
|
||||
if ( stepSize != 0.0 )
|
||||
|
@ -255,7 +255,7 @@ QRectF QskIntervalF::toRect( const QskIntervalF& intervalX,
|
||||
const QskIntervalF& intervalY ) noexcept
|
||||
{
|
||||
return QRectF( intervalX.lowerBound(), intervalY.lowerBound(),
|
||||
intervalX.width(), intervalY.width() ).normalized();
|
||||
intervalX.length(), intervalY.length() ).normalized();
|
||||
}
|
||||
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
|
@ -19,7 +19,7 @@ class QSK_EXPORT QskIntervalF
|
||||
|
||||
Q_PROPERTY( qreal lowerBound READ lowerBound WRITE setLowerBound )
|
||||
Q_PROPERTY( qreal upperBound READ upperBound WRITE setUpperBound )
|
||||
Q_PROPERTY( qreal width READ width )
|
||||
Q_PROPERTY( qreal length READ length )
|
||||
|
||||
public:
|
||||
constexpr QskIntervalF() noexcept = default;
|
||||
@ -39,8 +39,8 @@ class QSK_EXPORT QskIntervalF
|
||||
void spanFromLowerBound( qreal ) noexcept;
|
||||
void spanFromUpperBound( qreal ) noexcept;
|
||||
|
||||
constexpr qreal width() const noexcept;
|
||||
void setWidth( qreal ) noexcept;
|
||||
constexpr qreal length() const noexcept;
|
||||
void setLength( qreal ) noexcept;
|
||||
|
||||
constexpr bool contains( qreal value ) const noexcept;
|
||||
constexpr bool contains( const QskIntervalF& ) const noexcept;
|
||||
@ -135,14 +135,14 @@ inline constexpr qreal QskIntervalF::upperBound() const noexcept
|
||||
return m_upperBound;
|
||||
}
|
||||
|
||||
inline constexpr qreal QskIntervalF::width() const noexcept
|
||||
inline constexpr qreal QskIntervalF::length() const noexcept
|
||||
{
|
||||
return ( m_upperBound > m_lowerBound ) ? ( m_upperBound - m_lowerBound ) : 0.0;
|
||||
}
|
||||
|
||||
inline void QskIntervalF::setWidth( qreal width ) noexcept
|
||||
inline void QskIntervalF::setLength( qreal length ) noexcept
|
||||
{
|
||||
m_upperBound = m_lowerBound + width;
|
||||
m_upperBound = m_lowerBound + length;
|
||||
}
|
||||
|
||||
inline constexpr bool QskIntervalF::isValid() const noexcept
|
||||
|
@ -254,7 +254,7 @@ QSGNode* QskScaleRenderer::updateLabelsNode(
|
||||
|
||||
const qreal length = ( m_data->orientation == Qt::Horizontal )
|
||||
? tickmarksRect.width() : tickmarksRect.height();
|
||||
const qreal ratio = length / m_data->boundaries.width();
|
||||
const qreal ratio = length / m_data->boundaries.length();
|
||||
|
||||
auto nextNode = node->firstChild();
|
||||
|
||||
|
@ -41,7 +41,7 @@ void QskTickmarksNode::update(
|
||||
auto vertexData = geometry()->vertexDataAsPoint2D();
|
||||
|
||||
const qreal min = boundaries.lowerBound();
|
||||
const qreal range = boundaries.width();
|
||||
const qreal range = boundaries.length();
|
||||
|
||||
using TM = QskTickmarks;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user