blockly > blockRendering > MarkerSvg
blockRendering.MarkerSvg class
Class for a marker, containing methods for graphically rendering a marker as SVG.
Signature:
export declare class MarkerSvg
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(workspace, constants, marker) | Constructs a new instance of the MarkerSvg class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
colour_ | string | ||
constants_ | protected |
ConstantProvider | The constants necessary to draw the marker. |
currentMarkerSvg | SVGElement | null | The current SVG element for the marker. | |
markerBlock_ | protected |
SVGPathElement | null | |
markerInput_ | protected |
SVGPathElement | null | |
markerSvg_ | protected |
SVGGElement | null | The root SVG group containing the marker. |
markerSvgLine_ | protected |
SVGRectElement | null | |
markerSvgRect_ | protected |
SVGRectElement | null | |
svgGroup_ | protected |
SVGGElement | null |
Methods
Method | Modifiers | Description |
---|---|---|
applyColour_(_curNode) | protected |
Apply the marker's colour. |
createDom() | Create the DOM element for the marker. | |
createDomInternal_() | protected |
Create the marker SVG. |
dispose() | Dispose of this marker. | |
draw(oldNode, curNode) | Update the marker. | |
getBlinkProperties_() | protected |
Get the properties to make a marker blink. |
getMarker() | Get the marker. | |
getSvgRoot() | Return the root node of the SVG or null if none exists. | |
hide() | Hide the marker. | |
isCursor() | True if the marker should be drawn as a cursor, false otherwise. A cursor is drawn as a flashing line. A marker is drawn as a solid line. | |
positionBlock_(width, markerOffset, markerHeight) | protected |
Position the marker for a block. Displays an outline of the top half of a rectangle around a block. |
positionInput_(connection) | protected |
Position the marker for an input connection. Displays a filled in puzzle piece. |
positionLine_(x, y, width) | protected |
Move and show the marker at the specified coordinate in workspace units. Displays a horizontal line. |
positionOutput_(width, height, connectionShape) | protected |
Position the marker for an output connection. Displays a puzzle outline and the top and bottom path. |
positionPrevious_(width, markerOffset, markerHeight, connectionShape) | protected |
Position the marker for a previous connection. Displays a half rectangle with a notch in the top to represent the previous connection. |
positionRect_(x, y, width, height) | protected |
Move and show the marker at the specified coordinate in workspace units. Displays a filled in rectangle. |
setParent_(newParent) | protected |
Attaches the SVG root of the marker to the SVG group of the parent. |
showAtLocation_(curNode) | protected |
Update the marker's visible state based on the type of curNode.. |
showCurrent_() | protected |
Show the current marker. |
showWithBlock_(curNode) | protected |
Position and display the marker for a block. |
showWithButton_(curNode) | protected |
Position and display the marker for a flyout button. This is a box with extra padding around the button. |
showWithCoordinates_(curNode) | protected |
Position and display the marker for a workspace coordinate. This is a horizontal line. |
showWithField_(curNode) | protected |
Position and display the marker for a field. This is a box around the field. |
showWithInput_(curNode) | protected |
Position and display the marker for an input. This is a puzzle piece. |
showWithNext_(curNode) | protected |
Position and display the marker for a next connection. This is a horizontal line. |
showWithOutput_(curNode) | protected |
Position and display the marker for an output connection. |
showWithPrevious_(curNode) | protected |
Position and display the marker for a previous connection. |
showWithStack_(curNode) | protected |
Position and display the marker for a stack. This is a box with extra padding around the entire stack of blocks. |