public void CenterBrush(CellOffset[] brush) { //Debug.Log("center brush"); int halfColumnCount = ColumnCount / 2; int halfRowCount = RowCount / 2; int halfBrushWidth = BrushFactory.WidthForBrush(brush) / 2; int halfBrushHeight = BrushFactory.HeightForBrush(brush) / 2; Debug.Log("halfBrushWidth: " + halfBrushWidth + " halfColumnCount: " + halfColumnCount + " halfBrushHeight: " + halfBrushHeight + " halfRowCount: " + halfRowCount); if ((halfBrushWidth > halfColumnCount) || (halfBrushHeight > halfRowCount)) { SetBrushAt(0, 0, brush); } else { SetBrushAt(halfColumnCount - halfBrushWidth, halfRowCount - halfBrushHeight, brush); } }