blockly > blockRendering > PathObject
blockRendering.PathObject class
An object that handles creating and setting each of the SVG elements used by the renderer.
Signature:
export declare class PathObject implements IPathObject
Implements: IPathObject
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(root, style, constants) | Constructs a new instance of the PathObject class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
constants | ConstantProvider | ||
cursorSvg | SVGElement | null | Holds the cursors svg element when the cursor is attached to the block. This is null if there is no cursor on the block. | |
markerSvg | SVGElement | null | Holds the markers svg element when the marker is attached to the block. This is null if there is no marker on the block. | |
style | BlockStyle | ||
svgPath | SVGElement | ||
svgRoot | SVGElement |
Methods
Method | Modifiers | Description |
---|---|---|
addConnectionHighlight(connection, connectionPath, offset, rtl) | Adds the given path as a connection highlight for the given connection. | |
applyColour(block) | Apply the stored colours to the block's path, taking into account whether the paths belong to a shadow block. | |
flipRTL() | Flip the SVG paths in RTL. | |
removeConnectionHighlight(connection) | Removes any highlight associated with the given connection, if it exists. | |
setClass_(className, add) | protected |
Add or remove the given CSS class on the path object's root SVG element. |
setCursorSvg(cursorSvg) | Add the cursor SVG to this block's SVG group. | |
setMarkerSvg(markerSvg) | Add the marker SVG to this block's SVG group. | |
setPath(pathString) | Set the path generated by the renderer onto the respective SVG element. | |
setStyle(blockStyle) | Set the style. | |
updateDisabled_(disabled) | protected |
Updates the look of the block to reflect a disabled state. |
updateDraggingDelete(enable) | Add or remove styling showing that a block is dragged over a delete area. | |
updateHighlighted(enable) | Set whether the block shows a highlight or not. Block highlighting is often used to visually mark blocks currently being executed. | |
updateInsertionMarker(enable) | Add or remove styling showing that a block is an insertion marker. | |
updateMovable(enable) | Add or remove styling showing that a block is movable. | |
updateReplacementFade(enable) | Add or remove styling that shows that if the dragging block is dropped, this block will be replaced. If a shadow block, it will disappear. Otherwise it will bump. | |
updateSelected(enable) | Add or remove styling showing that a block is selected. | |
updateShadow_(shadow) | protected |
Updates the look of the block to reflect a shadow state. |
updateShapeForInputHighlight(_conn, _enable) | Add or remove styling that shows that if the dragging block is dropped, this block will be connected to the input. |