Constructor

ConstantProvider

new ConstantProvider()

An object that provides constants for rendering blocks.

Properties

CORNER_RADIUS

number

Rounded corner radius.

EMPTY_STATEMENT_INPUT_HEIGHT

constant

number

The height of an empty statement input. Note that in the old rendering this varies slightly depending on whether the block has external or inline inputs. In the new rendering this is consistent. It seems unlikely that the old behaviour was intentional.

INSIDE_CORNERS

non-null Object

An object containing sizing and path information about inside corners

JAGGED_TEETH

non-null Object

An object containing sizing and path information about collapsed block indicators.

JAGGED_TEETH_HEIGHT

constant

Height of SVG path for jagged teeth at the end of collapsed blocks.

JAGGED_TEETH_WIDTH

constant

Width of SVG path for jagged teeth at the end of collapsed blocks.

NOTCH

non-null Object

An object containing sizing and path information about notches.

OUTSIDE_CORNERS

non-null Object

An object containing sizing and path information about outside corners.

PUZZLE_TAB

non-null Object

An object containing sizing and path information about puzzle tabs.

START_HAT

non-null Object

An object containing sizing and path information about start hats

Methods

init

package

init()

Initialize shape objects based on the constants set in the constructor.

makeInsideCorners

package

makeInsideCorners() returns Object

Returns

non-null Object An object containing sizing and path information about inside corners.

makeJaggedTeeth

package

makeJaggedTeeth() returns Object

Returns

non-null Object An object containing sizing and path information about collapsed block indicators.

makeNotch

package

makeNotch() returns Object

Returns

non-null Object An object containing sizing and path information about notches.

makeOutsideCorners

package

makeOutsideCorners() returns Object

Returns

non-null Object An object containing sizing and path information about outside corners.

makePuzzleTab

package

makePuzzleTab() returns Object

Returns

non-null Object An object containing sizing and path information about puzzle tabs.

makeStartHat

package

makeStartHat() returns Object

Returns

non-null Object An object containing sizing and path information about start hats.

shapeFor

package

shapeFor(connection) returns Object

Get an object with connection shape and sizing information based on the type of the connection.

Parameter

connection

Blockly.RenderedConnection

The connection to find a shape object for

Value must not be null.

Returns

non-null Object The shape object for the connection.