Sets the horizontal placement of the tile in the list.
(tile: MatGridTile, colIndex: number, percentWidth: number, gutterWidth: number)
| 109 | |
| 110 | /** Sets the horizontal placement of the tile in the list. */ |
| 111 | setColStyles(tile: MatGridTile, colIndex: number, percentWidth: number, gutterWidth: number) { |
| 112 | // Base horizontal size of a column. |
| 113 | let baseTileWidth = this.getBaseTileSize(percentWidth, gutterWidth); |
| 114 | |
| 115 | // The width and horizontal position of each tile is always calculated the same way, but the |
| 116 | // height and vertical position depends on the rowMode. |
| 117 | let side = this._direction === 'rtl' ? 'right' : 'left'; |
| 118 | tile._setStyle(side, this.getTilePosition(baseTileWidth, colIndex)); |
| 119 | tile._setStyle('width', calc(this.getTileSize(baseTileWidth, tile.colspan))); |
| 120 | } |
| 121 | |
| 122 | /** |
| 123 | * Calculates the total size taken up by gutters across one axis of a list. |