Stay organized with collections Save and categorize content based on your preferences.

blockly > blockRendering > Drawer

blockRendering.Drawer class

An object that draws a block based on the given rendering information.

Signature:

export declare class Drawer 

Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the Drawer class.

Properties

Property Modifiers Type Description
block_ BlockSvg
constants_ protected ConstantProvider
info_ RenderInfo
inlinePath_ string
outlinePath_ string
topLeft_ Coordinate

Methods

Method Modifiers Description
drawBottom_() protected Add steps for the bottom edge of a block, possibly including a notch for the next connection.
drawInlineInput_(input) protected Add steps for an inline input.
drawInternals_() protected Draw the internals of the block: inline inputs, fields, and icons. These do not depend on the outer path for placement.
drawJaggedEdge_(row) protected Add steps for the jagged edge of a row on a collapsed block.
drawLeft_() protected Add steps for the left side of the block, which may include an output connection
drawOutline_() protected Create the outline of the block. This is a single continuous path.
drawRightSideRow_(row) protected Add steps for the right side of a row that does not have value or statement input connections.
drawStatementInput_(row) protected Add steps for a statement input.
drawTop_() protected Add steps for the top corner of the block, taking into account details such as hats and rounded corners.
drawValueInput_(row) protected Add steps for an external value input, rendered as a notch in the side of the block.
hideHiddenIcons_() protected Hide icons that were marked as hidden.
layoutField_(fieldInfo) protected Push a field or icon's new position to its SVG root.
positionExternalValueConnection_(row) protected Position the connection on an external value input, taking into account RTL and the small gap between the parent block and child block which lets the parent block's dark path show through.
positionInlineInputConnection_(input) protected Position the connection on an inline value input, taking into account RTL and the small gap between the parent block and child block which lets the parent block's dark path show through.
positionNextConnection_() protected Position the next connection on a block.
positionOutputConnection_() protected Position the output connection on a block.
positionPreviousConnection_() protected Position the previous connection on a block.
positionStatementInputConnection_(row) protected Position the connection on a statement input, taking into account RTL and the small gap between the parent block and child block which lets the parent block's dark path show through.
recordSizeOnBlock_() protected Save sizing information back to the block Most of the rendering information can be thrown away at the end of the render. Anything that needs to be kept around should be set in this function.