Skip to main content

Home > blockly > blockRendering > RenderInfo > getElemCenterline_

blockRendering.RenderInfo.getElemCenterline_() method

Calculate the centerline of an element in a rendered row. This base implementation puts the centerline at the middle of the row vertically, with no special cases. You will likely need extra logic to handle (at minimum) top and bottom rows.

Signature:

protected getElemCenterline_(row: Row, elem: Measurable): number;

Parameters

ParameterTypeDescription
rowRowThe row containing the element.
elemMeasurableThe element to place.

Returns:

number

The desired centerline of the given element, as an offset from the top left of the block.