blockly > Flyout > createRect_
Flyout.createRect_() method
Create and place a rectangle corresponding to the given block.
Signature:
protected createRect_(block: BlockSvg, x: number, y: number, blockHW: {
height: number;
width: number;
}, index: number): SVGElement;
Parameters
Parameter | Type | Description |
---|---|---|
block | BlockSvg | The block to associate the rect to. |
x | number | The x position of the cursor during this layout pass. |
y | number | The y position of the cursor during this layout pass. |
blockHW | { height: number; width: number; } | The height and width of the block. |
index | number | The index into the mats list where this rect should be placed. |
Returns:
SVGElement
Newly created SVG element for the rectangle behind the block.