Skip to main content

Interface: IPathObject

Defined in: packages/blockly/core/renderers/common/i_path_object.ts:21

An interface for a block's path object.

Param

_root

The root SVG element.

Param

_constants

The renderer's constants.

Properties index

PropertyDescription
svgPathThe primary path of the block.
constantsThe renderer's constant provider.
styleThe primary path of the block.

Methods index

MethodDescription
setPathSet the path generated by the renderer onto the respective SVG element.
flipRTLFlip the SVG paths in RTL.
updateHighlightedSet whether the block shows a highlight or not. Block highlighting is often used to visually mark blocks currently being executed.
updateSelectedAdd or remove styling showing that a block is selected.
updateDraggingDeleteAdd or remove styling showing that a block is dragged over a delete area.
updateInsertionMarkerAdd or remove styling showing that a block is an insertion marker.
updateMovableAdd or remove styling showing that a block is movable.
addConnectionHighlightAdds the given path as a connection highlight for the given connection.
applyColourApply the stored colours to the block's path, taking into account whether the paths belong to a shadow block.
removeConnectionHighlightRemoves any highlight associated with the given connection, if it exists.
setStyleUpdate the style.
updateReplacingAdd or remove styling indicating that a block will be bumped out and replaced by another block that is mid-move.

Properties

svgPath

svgPath: SVGElement;

Defined in: packages/blockly/core/renderers/common/i_path_object.ts:25

The primary path of the block.


constants

constants: ConstantProvider;

Defined in: packages/blockly/core/renderers/common/i_path_object.ts:28

The renderer's constant provider.


style

style: BlockStyle;

Defined in: packages/blockly/core/renderers/common/i_path_object.ts:31

The primary path of the block.

Methods

setPath()

setPath(pathString): void;

Defined in: packages/blockly/core/renderers/common/i_path_object.ts:38

Set the path generated by the renderer onto the respective SVG element.

Parameters

ParameterTypeDescription
pathStringstringThe path.

Returns

void


flipRTL()

flipRTL(): void;

Defined in: packages/blockly/core/renderers/common/i_path_object.ts:43

Flip the SVG paths in RTL.

Returns

void


updateHighlighted()

updateHighlighted(highlighted): void;

Defined in: packages/blockly/core/renderers/common/i_path_object.ts:51

Set whether the block shows a highlight or not. Block highlighting is often used to visually mark blocks currently being executed.

Parameters

ParameterTypeDescription
highlightedbooleanTrue if highlighted.

Returns

void


updateSelected()

updateSelected(enabled): void;

Defined in: packages/blockly/core/renderers/common/i_path_object.ts:58

Add or remove styling showing that a block is selected.

Parameters

ParameterType
enabledboolean

Returns

void


updateDraggingDelete()

updateDraggingDelete(enabled): void;

Defined in: packages/blockly/core/renderers/common/i_path_object.ts:66

Add or remove styling showing that a block is dragged over a delete area.

Parameters

ParameterType
enabledboolean

Returns

void


updateInsertionMarker()

updateInsertionMarker(enabled): void;

Defined in: packages/blockly/core/renderers/common/i_path_object.ts:73

Add or remove styling showing that a block is an insertion marker.

Parameters

ParameterType
enabledboolean

Returns

void


updateMovable()

updateMovable(enabled): void;

Defined in: packages/blockly/core/renderers/common/i_path_object.ts:80

Add or remove styling showing that a block is movable.

Parameters

ParameterType
enabledboolean

Returns

void


addConnectionHighlight()?

optional addConnectionHighlight(
connection,
connectionPath,
offset,
rtl
): SVGElement;

Defined in: packages/blockly/core/renderers/common/i_path_object.ts:83

Adds the given path as a connection highlight for the given connection.

Parameters

ParameterType
connectionRenderedConnection
connectionPathstring
offsetCoordinate
rtlboolean

Returns

SVGElement


applyColour()?

optional applyColour(block): void;

Defined in: packages/blockly/core/renderers/common/i_path_object.ts:96

Apply the stored colours to the block's path, taking into account whether the paths belong to a shadow block.

Parameters

ParameterTypeDescription
blockBlockSvgThe source block.

Returns

void


removeConnectionHighlight()?

optional removeConnectionHighlight(connection): void;

Defined in: packages/blockly/core/renderers/common/i_path_object.ts:101

Removes any highlight associated with the given connection, if it exists.

Parameters

ParameterType
connectionRenderedConnection

Returns

void


setStyle()?

optional setStyle(blockStyle): void;

Defined in: packages/blockly/core/renderers/common/i_path_object.ts:108

Update the style.

Parameters

ParameterTypeDescription
blockStyleBlockStyleThe block style to use.

Returns

void


updateReplacing()?

optional updateReplacing(replacing): void;

Defined in: packages/blockly/core/renderers/common/i_path_object.ts:117

Add or remove styling indicating that a block will be bumped out and replaced by another block that is mid-move.

Parameters

ParameterTypeDescription
replacingbooleanTrue if the block is at risk of being replaced, false otherwise.

Returns

void