void computeDebugRects( float x, float y, float layoutX, float layoutY, float layoutWidth, float layoutHeight, float tableWidth, float tableHeight, float hpadding, float vpadding )
{
if( _debugRects != null )
_debugRects.Clear();
var currentX = x;
var currentY = y;
if( _tableDebug == TableDebug.Table || _tableDebug == TableDebug.All )
{
addDebugRect( layoutX, layoutY, layoutWidth, layoutHeight, debugTableColor );
addDebugRect( x, y, tableWidth - hpadding, tableHeight - vpadding, debugTableColor );
}
for( var i = 0; i < _cells.Count; i++ )
{
var cell = _cells[i];
// element bounds.
if( _tableDebug == TableDebug.Element || _tableDebug == TableDebug.All )
addDebugRect( cell.elementX, cell.elementY, cell.elementWidth, cell.elementHeight, debugElementColor );
// Cell bounds.
float spannedCellWidth = 0;
for( int column = cell.column, nn = column + cell.colspan.Value; column < nn; column++ )
spannedCellWidth += _columnWidth[column];
spannedCellWidth -= cell.computedPadLeft + cell.computedPadRight;
currentX += cell.computedPadLeft;
if( _tableDebug == TableDebug.Cell || _tableDebug == TableDebug.All )
{
addDebugRect( currentX, currentY + cell.computedPadTop, spannedCellWidth,
_rowHeight[cell.row] - cell.computedPadTop - cell.computedPadBottom, debugCellColor );
}
if( cell.endRow )
{
currentX = x;
currentY += _rowHeight[cell.row];
}
else
{
currentX += spannedCellWidth + cell.computedPadRight;
}
}
}