Skip to main content

Home > blockly > blockRendering > TopRow

blockRendering.TopRow class

An object containing information about what elements are in the top row of a block as well as sizing information for the top row. Elements in a top row can consist of corners, hats, spacers, and previous connections. After this constructor is called, the row will contain all non-spacer elements it needs.

Signature:

export declare class TopRow extends Row 

Extends: Row

Constructors

ConstructorModifiersDescription
(constructor)(constants)Constructs a new instance of the TopRow class

Properties

PropertyModifiersTypeDescription
ascenderHeightnumberHow much the row extends up above its capline.
caplinenumberThe starting point for drawing the row, in the y direction. This allows us to draw hats and similar shapes that don't start at the origin. Must be non-negative (see #2820).
connectionPreviousConnection | nullThe previous connection on the block, if any.
hasPreviousConnectionbooleanWhether the block has a previous connection.

Methods

MethodModifiersDescription
endsWithElemSpacer()
hasLeftSquareCorner(block)Returns whether or not the top row has a left square corner.
hasRightSquareCorner(_block)Returns whether or not the top row has a right square corner.
measure()
startsWithElemSpacer()