qskBoundedConstraint fixed

This commit is contained in:
Uwe Rathmann 2019-09-20 17:57:02 +02:00
parent 77c9809574
commit 4224613e15

View File

@ -422,19 +422,19 @@ static QSizeF qskBoundedConstraint( const QQuickItem* item,
const auto hintMax = ( whichMax == whichMin ) const auto hintMax = ( whichMax == whichMin )
? hintMin : qskEffectiveSizeHint( item, whichMax ); ? hintMin : qskEffectiveSizeHint( item, whichMax );
QSizeF size; QSizeF size = constraint;
if ( orientation == Qt::Horizontal ) if ( orientation == Qt::Horizontal )
{ {
if ( hintMax.width() >= 0.0 ) if ( hintMax.width() >= 0.0 )
size.rwidth() = qMin( constraint.width(), hintMax.width() ); size.rwidth() = qMin( size.width(), hintMax.width() );
size.rwidth() = qMax( size.width(), hintMin.width() ); size.rwidth() = qMax( size.width(), hintMin.width() );
} }
else else
{ {
if ( hintMax.height() >= 0.0 ) if ( hintMax.height() >= 0.0 )
size.rheight() = qMin( constraint.height(), hintMax.height() ); size.rheight() = qMin( size.height(), hintMax.height() );
size.rheight() = qMax( size.height(), hintMin.height() ); size.rheight() = qMax( size.height(), hintMin.height() );
} }