Constructor

Drawer

new Drawer(block, info)

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

Parameter

block

Blockly.BlockSvg

The block to render.

Value must not be null.

info

Blockly.zelos.RenderInfo

An object containing all information needed to render this block.

Value must not be null.

Extends
Blockly.blockRendering.Drawer

Property

constants_

protected

unknown

The renderer's constant provider.

Inherited from
Blockly.blockRendering.Drawer#constants_

Methods

draw

package

draw()

Draw the block to the workspace. Here "drawing" means setting SVG path elements and moving fields, icons, and connections on the screen.

The pieces of the paths are pushed into arrays of "steps", which are then joined with spaces and set directly on the block. This guarantees that the steps are separated by spaces for improved readability, but isn't required.

Inherited from
Blockly.blockRendering.Drawer#draw

drawBottom_

protected

drawBottom_()

Add steps for the bottom edge of a block, possibly including a notch for the next connection

drawFlatBottom_

protected

drawFlatBottom_()

Add steps to draw a flat bottom row.

drawFlatTop_

protected

drawFlatTop_()

Add steps to draw a flat top row.

drawInlineInput_

protected

drawInlineInput_(input)

Add steps for an inline input.

Parameter

input

The information about the input to render.

Value must not be null.

Inherited from
Blockly.zelos.Drawer#drawInlineInput_

drawInternals_

protected

drawInternals_()

Draw the internals of the block: inline inputs, fields, and icons. These do not depend on the outer path for placement.

Inherited from
Blockly.blockRendering.Drawer#drawInternals_

drawJaggedEdge_

protected

drawJaggedEdge_(row)

Add steps for the jagged edge of a row on a collapsed block.

Parameter

row

The row to draw the side of.

Value must not be null.

Inherited from
Blockly.blockRendering.Drawer#drawJaggedEdge_

drawLeft_

protected

drawLeft_()

Add steps for the left side of the block, which may include an output connection

Inherited from
Blockly.blockRendering.Drawer#drawLeft_

drawLeftDynamicConnection_

protected

drawLeftDynamicConnection_()

Add steps to draw the left side of an output with a dynamic connection.

drawOutline_

protected

drawOutline_()

Create the outline of the block. This is a single continuous path.

Inherited from
Blockly.zelos.Drawer#drawOutline_

drawRightDynamicConnection_

protected

drawRightDynamicConnection_()

Add steps to draw the right side of an output with a dynamic connection.

drawRightSideRow_

protected

drawRightSideRow_(row)

Add steps for the right side of a row that does not have value or statement input connections.

Parameter

row

Blockly.blockRendering.Row

The row to draw the side of.

Value must not be null.

drawStatementInput_

protected

drawStatementInput_(row)

Add steps for a statement input.

Parameter

row

The row that this input belongs to.

Value must not be null.

Inherited from
Blockly.blockRendering.Drawer#drawStatementInput_

drawTop_

protected

drawTop_()

Add steps for the top corner of the block, taking into account details such as hats and rounded corners.

drawValueInput_

protected

drawValueInput_(row)

Add steps for an external value input, rendered as a notch in the side of the block.

Parameter

row

The row that this input belongs to.

Value must not be null.

Inherited from
Blockly.blockRendering.Drawer#drawValueInput_

hideHiddenIcons_

protected

hideHiddenIcons_()

Hide icons that were marked as hidden.

Inherited from
Blockly.blockRendering.Drawer#hideHiddenIcons_

layoutField_

protected

layoutField_(fieldInfo)

Push a field or icon's new position to its SVG root.

Parameter

fieldInfo

The rendering information for the field or icon.

Inherited from
Blockly.blockRendering.Drawer#layoutField_

positionExternalValueConnection_

protected

positionExternalValueConnection_(row)

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.

Parameter

row

The row that the connection is on.

Value must not be null.

Inherited from
Blockly.blockRendering.Drawer#positionExternalValueConnection_

positionInlineInputConnection_

protected

positionInlineInputConnection_(input)

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.

Parameter

input

The information about the input that the connection is on.

Inherited from
Blockly.blockRendering.Drawer#positionInlineInputConnection_

positionNextConnection_

protected

positionNextConnection_()

Position the next connection on a block.

Inherited from
Blockly.blockRendering.Drawer#positionNextConnection_

positionOutputConnection_

protected

positionOutputConnection_()

Position the output connection on a block.

Inherited from
Blockly.blockRendering.Drawer#positionOutputConnection_

positionPreviousConnection_

protected

positionPreviousConnection_()

Position the previous connection on a block.

Inherited from
Blockly.blockRendering.Drawer#positionPreviousConnection_

positionStatementInputConnection_

protected

positionStatementInputConnection_(row)

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.

Parameter

row

The row that the connection is on.

Value must not be null.

Inherited from
Blockly.blockRendering.Drawer#positionStatementInputConnection_

recordSizeOnBlock_

protected

recordSizeOnBlock_()

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.

Inherited from
Blockly.blockRendering.Drawer#recordSizeOnBlock_