Skip to content

Function: coverRect() ​

ts
function coverRect(
   cell, 
   layout, 
   options
): Rect;

Where to draw an image (in layout units) so it covers a cell's box, like CSS object-fit: cover, with its focal point as near as it can get to the middle of what shows of the cell. A cut tile, a triangle or a tall thin tile then shows a photo's subject rather than whatever was in the middle of the photo. Clip the image to the cell as usual.

Parameters ​

ParameterType
cellCell
layoutPick<Layout, "cornerRadius" | "view">
optionsCoverOptions

Returns ​

Rect

Hat tiling and isohedral tilings after Craig S. Kaplan's hatviz and Tactile (BSD 3-Clause).