snap mode improved for unaligned boundaries
This commit is contained in:
parent
a73df141c6
commit
1f8ec04bde
|
@ -123,13 +123,18 @@ void QskBoundedInput::alignInput()
|
||||||
|
|
||||||
qreal QskBoundedInput::alignedValue( qreal value ) const
|
qreal QskBoundedInput::alignedValue( qreal value ) const
|
||||||
{
|
{
|
||||||
if ( m_snap )
|
value = boundedValue( value );
|
||||||
|
|
||||||
|
if ( value > minimum() && value < maximum() )
|
||||||
{
|
{
|
||||||
if ( const auto step = m_stepSize )
|
if ( m_snap && m_stepSize )
|
||||||
value = qRound( value / step ) * step;
|
{
|
||||||
|
value = qRound( value / m_stepSize ) * m_stepSize;
|
||||||
|
value = boundedValue( value );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return boundedValue( value );
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
QskIntervalF QskBoundedInput::alignedInterval( const QskIntervalF& interval ) const
|
QskIntervalF QskBoundedInput::alignedInterval( const QskIntervalF& interval ) const
|
||||||
|
|
Loading…
Reference in New Issue