MCPcopy Create free account
hub / github.com/hashintel/hash / getYCenter

Function getYCenter

apps/hash-frontend/src/components/grid/utils.ts:8–15  ·  view source on GitHub ↗
(
  args: Pick<DrawArgs<CustomCell>, "rect" | "ctx"> & { theme: Theme },
)

Source from the content-addressed store, hash-verified

6 * @returns vertical center of a grid cell, relative to the visible grid area
7 */
8export const getYCenter = (
9 args: Pick<DrawArgs<CustomCell>, "rect" | "ctx"> & { theme: Theme },
10) => {
11 const { rect, ctx, theme } = args;
12 const { y, height } = rect;
13
14 return y + height / 2 + getMiddleCenterBias(ctx, theme.fontFamily);
15};
16
17/**
18 * @param atFirstColumn first columns has extra padding for the chevron icon on the left side

Callers 15

drawUrlAsLinkFunction · 0.90
drawChipFunction · 0.90
drawChipWithTextFunction · 0.90
useDrawHeaderFunction · 0.90
drawChipWithIconFunction · 0.90
drawTextWithIconFunction · 0.90
createRenderTextIconCellFunction · 0.90
link-cell.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected