fix crash in grid layout
This commit is contained in:
parent
250e9ac238
commit
e4cb9b27db
|
@ -86,6 +86,9 @@ bool UIGridLayout::internalUpdate()
|
|||
if(m_flow && m_cellSize.width() > 0)
|
||||
numColumns = clippingRect.width() / (m_cellSize.width() + m_cellSpacing);
|
||||
|
||||
if(numColumns <= 0)
|
||||
numColumns = 1;
|
||||
|
||||
int cellSpacing = m_cellSpacing;
|
||||
if(m_autoSpacing && numColumns > 1)
|
||||
cellSpacing = (clippingRect.width() - numColumns * m_cellSize.width()) / (numColumns - 1);
|
||||
|
|
Loading…
Reference in New Issue