* Sets the style properties to be applied to a tile for the given row and column index. * @param tile Tile to which to apply the styling. * @param rowIndex Index of the tile's row. * @param colIndex Index of the tile's column.
(tile: MatGridTile, rowIndex: number, colIndex: number)
| 96 | * @param colIndex Index of the tile's column. |
| 97 | */ |
| 98 | setStyle(tile: MatGridTile, rowIndex: number, colIndex: number): void { |
| 99 | // Percent of the available horizontal space that one column takes up. |
| 100 | let percentWidthPerTile = 100 / this._cols; |
| 101 | |
| 102 | // Fraction of the vertical gutter size that each column takes up. |
| 103 | // For example, if there are 5 columns, each column uses 4/5 = 0.8 times the gutter width. |
| 104 | let gutterWidthFractionPerTile = (this._cols - 1) / this._cols; |
| 105 | |
| 106 | this.setColStyles(tile, colIndex, percentWidthPerTile, gutterWidthFractionPerTile); |
| 107 | this.setRowStyles(tile, rowIndex, percentWidthPerTile, gutterWidthFractionPerTile); |
| 108 | } |
| 109 | |
| 110 | /** Sets the horizontal placement of the tile in the list. */ |
| 111 | setColStyles(tile: MatGridTile, colIndex: number, percentWidth: number, gutterWidth: number) { |
nothing calls this directly
no test coverage detected