MCPcopy Create free account
hub / github.com/angular/components / getTilePosition

Function getTilePosition

src/material/grid-list/tile-styler.ts:76–80  ·  view source on GitHub ↗

* Gets The horizontal or vertical position of a tile, e.g., the 'top' or 'left' property value. * @param offset Number of tiles that have already been rendered in the row/column. * @param baseSize Base size of a 1x1 tile (as computed in getBaseTileSize). * @return Position of the tile as a

(baseSize: string, offset: number)

Source from the content-addressed store, hash-verified

74 * @return Position of the tile as a CSS calc() expression.
75 */
76 getTilePosition(baseSize: string, offset: number): string {
77 // The position comes the size of a 1x1 tile plus gutter for each previous tile in the
78 // row/column (offset).
79 return offset === 0 ? '0' : calc(`(${baseSize} + ${this._gutterSize}) * ${offset}`);
80 }
81
82 /**
83 * Gets the actual size of a tile, e.g., width or height, taking rowspan or colspan into account.

Callers

nothing calls this directly

Calls 1

calcFunction · 0.85

Tested by

no test coverage detected