addCell -> expandTo
This commit is contained in:
parent
bfe2b58ae3
commit
49c216b582
@ -34,13 +34,13 @@ void QskLayoutChain::reset( int count, qreal constraint )
|
|||||||
m_sumStretches = 0;
|
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;
|
cell.canGrow |= newCell.canGrow;
|
||||||
combinedCell.stretch = qMax( combinedCell.stretch, cell.stretch );
|
cell.stretch = qMax( cell.stretch, newCell.stretch );
|
||||||
combinedCell.hint.intersect( cell.hint );
|
cell.hint.intersect( newCell.hint );
|
||||||
}
|
}
|
||||||
|
|
||||||
void QskLayoutChain::finish()
|
void QskLayoutChain::finish()
|
||||||
|
@ -52,7 +52,7 @@ class QskLayoutChain
|
|||||||
void invalidate();
|
void invalidate();
|
||||||
|
|
||||||
void reset( int count, qreal constraint );
|
void reset( int count, qreal constraint );
|
||||||
void addCell( int index, const Cell& );
|
void expandTo( int index, const Cell& );
|
||||||
void finish();
|
void finish();
|
||||||
|
|
||||||
const Cell& cell( int index ) const { return m_cells[ index ]; }
|
const Cell& cell( int index ) const { return m_cells[ index ]; }
|
||||||
|
@ -616,7 +616,7 @@ void EntryTable::resetChain( Qt::Orientation orientation,
|
|||||||
constraints.isEmpty() ? -1.0 : constraints[index1].length;
|
constraints.isEmpty() ? -1.0 : constraints[index1].length;
|
||||||
|
|
||||||
const auto cell = this->cell( entry, orientation, cellConstraint );
|
const auto cell = this->cell( entry, orientation, cellConstraint );
|
||||||
chain.addCell( index2, cell );
|
chain.expandTo( index2, cell );
|
||||||
|
|
||||||
if ( m_orientation != orientation )
|
if ( m_orientation != orientation )
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user