addCell -> expandTo

This commit is contained in:
Uwe Rathmann 2019-07-09 14:52:43 +02:00
parent bfe2b58ae3
commit 49c216b582
3 changed files with 7 additions and 7 deletions

View File

@ -34,13 +34,13 @@ void QskLayoutChain::reset( int count, qreal constraint )
m_sumStretches = 0;
}
void QskLayoutChain::addCell( int index, const Cell& cell )
void QskLayoutChain::expandTo( int index, const Cell& newCell )
{
auto& combinedCell = m_cells[ index ];
auto& cell = m_cells[ index ];
combinedCell.canGrow |= cell.canGrow;
combinedCell.stretch = qMax( combinedCell.stretch, cell.stretch );
combinedCell.hint.intersect( cell.hint );
cell.canGrow |= newCell.canGrow;
cell.stretch = qMax( cell.stretch, newCell.stretch );
cell.hint.intersect( newCell.hint );
}
void QskLayoutChain::finish()

View File

@ -52,7 +52,7 @@ class QskLayoutChain
void invalidate();
void reset( int count, qreal constraint );
void addCell( int index, const Cell& );
void expandTo( int index, const Cell& );
void finish();
const Cell& cell( int index ) const { return m_cells[ index ]; }

View File

@ -616,7 +616,7 @@ void EntryTable::resetChain( Qt::Orientation orientation,
constraints.isEmpty() ? -1.0 : constraints[index1].length;
const auto cell = this->cell( entry, orientation, cellConstraint );
chain.addCell( index2, cell );
chain.expandTo( index2, cell );
if ( m_orientation != orientation )
{