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
| Property | Description |
|---|---|
| svgPath | The primary path of the block. |
| constants | The renderer's constant provider. |
| style | The primary path of the block. |
Methods index
| Method | Description |
|---|---|
| setPath | Set the path generated by the renderer onto the respective SVG element. |
| flipRTL | Flip the SVG paths in RTL. |
| updateHighlighted | Set whether the block shows a highlight or not. Block highlighting is often used to visually mark blocks currently being executed. |
| updateSelected | Add or remove styling showing that a block is selected. |
| updateDraggingDelete | Add or remove styling showing that a block is dragged over a delete area. |
| updateInsertionMarker | Add or remove styling showing that a block is an insertion marker. |
| updateMovable | Add or remove styling showing that a block is movable. |
| addConnectionHighlight | Adds the given path as a connection highlight for the given connection. |
| applyColour | Apply the stored colours to the block's path, taking into account whether the paths belong to a shadow block. |
| removeConnectionHighlight | Removes any highlight associated with the given connection, if it exists. |
| setStyle | Update the style. |
| updateReplacing | Add 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
| Parameter | Type | Description |
|---|---|---|
pathString | string | The 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
| Parameter | Type | Description |
|---|---|---|
highlighted | boolean | True 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
| Parameter | Type |
|---|---|
enabled | boolean |
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
| Parameter | Type |
|---|---|
enabled | boolean |
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
| Parameter | Type |
|---|---|
enabled | boolean |
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
| Parameter | Type |
|---|---|
enabled | boolean |
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
| Parameter | Type |
|---|---|
connection | RenderedConnection |
connectionPath | string |
offset | Coordinate |
rtl | boolean |
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
| Parameter | Type | Description |
|---|---|---|
block | BlockSvg | The 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
| Parameter | Type |
|---|---|
connection | RenderedConnection |
Returns
void
setStyle()?
optional setStyle(blockStyle): void;
Defined in: packages/blockly/core/renderers/common/i_path_object.ts:108
Update the style.
Parameters
| Parameter | Type | Description |
|---|---|---|
blockStyle | BlockStyle | The 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
| Parameter | Type | Description |
|---|---|---|
replacing | boolean | True if the block is at risk of being replaced, false otherwise. |
Returns
void