| 222 | } |
| 223 | |
| 224 | setRowStyles( |
| 225 | tile: MatGridTile, |
| 226 | rowIndex: number, |
| 227 | percentWidth: number, |
| 228 | gutterWidth: number, |
| 229 | ): void { |
| 230 | let percentHeightPerTile = percentWidth / this.rowHeightRatio; |
| 231 | this.baseTileHeight = this.getBaseTileSize(percentHeightPerTile, gutterWidth); |
| 232 | |
| 233 | // Use padding-top and margin-top to maintain the given aspect ratio, as |
| 234 | // a percentage-based value for these properties is applied versus the *width* of the |
| 235 | // containing block. See http://www.w3.org/TR/CSS2/box.html#margin-properties |
| 236 | tile._setStyle('marginTop', this.getTilePosition(this.baseTileHeight, rowIndex)); |
| 237 | tile._setStyle('paddingTop', calc(this.getTileSize(this.baseTileHeight, tile.rowspan))); |
| 238 | } |
| 239 | |
| 240 | override getComputedHeight(): [string, string] { |
| 241 | return [ |