Stay organized with collections Save and categorize content based on your preferences.

blockly > Flyout > createRect_

Flyout.createRect_() method

Create and place a rectangle corresponding to the given block.


protected createRect_(block: BlockSvg, x: number, y: number, blockHW: {
        height: number;
        width: number;
    }, index: number): SVGElement;


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.



Newly created SVG element for the rectangle behind the block.