division by zero fixed
This commit is contained in:
parent
9f74523b88
commit
f0f2df43c0
|
@ -381,6 +381,9 @@ QskLayoutChain::Segments QskLayoutChain::preferredStretched( qreal size ) const
|
|||
{
|
||||
const int count = m_cells.size();
|
||||
|
||||
if ( count == 0 )
|
||||
return Segments();
|
||||
|
||||
qreal sumFactors = 0.0;
|
||||
|
||||
QVarLengthArray< qreal > factors( count );
|
||||
|
@ -413,7 +416,11 @@ QskLayoutChain::Segments QskLayoutChain::preferredStretched( qreal size ) const
|
|||
sumFactors += factors[i];
|
||||
}
|
||||
|
||||
auto sumSizes = size - ( m_validCells - 1 ) * m_spacing;
|
||||
qreal sumSizes = 0.0;
|
||||
|
||||
if ( sumFactors > 0.0 )
|
||||
{
|
||||
sumSizes = size - ( m_validCells - 1 ) * m_spacing;
|
||||
|
||||
Q_FOREVER
|
||||
{
|
||||
|
@ -444,6 +451,7 @@ QskLayoutChain::Segments QskLayoutChain::preferredStretched( qreal size ) const
|
|||
if ( done )
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
qreal offset = 0;
|
||||
qreal fillSpacing = 0.0;
|
||||
|
|
Loading…
Reference in New Issue