Constructor

Debug

new Debug()

An object that renders rectangles and dots for debugging rendering code.

Properties

config

static

non-null Object with boolean properties

Configuration object containing booleans to enable and disable debug rendering of specific rendering components.

debugElements_

Array of non-null SVGElement

An array of SVG elements that have been created by this object.

svgRoot_

SVGElement

The SVG root of the block that is being rendered. Debug elements will be attached to this root.

Methods

clearElems

package

clearElems()

Remove all elements the this object created on the last pass.

drawBoundingBox

package

drawBoundingBox(info)

Draw a debug rectangle around the entire block.

Parameter

info

Blockly.blockRendering.RenderInfo

Rendering information about the block to debug.

Value must not be null.

drawConnection

package

drawConnection(conn)

Draw a circle at the location of the given connection. Inputs and outputs share the same colors, as do previous and next. When positioned correctly a connected pair will look like a bullseye.

Parameter

conn

Blockly.RenderedConnection

The connection to circle.

drawDebug

package

drawDebug(block, info)

Do all of the work to draw debug information for the whole block.

Parameter

block

Blockly.BlockSvg

The block to draw debug information for.

Value must not be null.

info

Blockly.blockRendering.RenderInfo

Rendering information about the block to debug.

Value must not be null.

drawRenderedElem

package

drawRenderedElem(elem, isRtl)

Draw a debug rectangle for an in-row element.

Parameter

elem

Blockly.blockRendering.Measurable

The element to render.

Value must not be null.

isRtl

boolean

Whether the block is rendered RTL.

drawRenderedRow

package

drawRenderedRow(row, cursorY, isRtl)

Draw a debug rectangle for a non-empty row.

Parameter

row

Blockly.blockRendering.Row

The non-empty row to render.

Value must not be null.

cursorY

number

The y position of the top of the row.

isRtl

boolean

Whether the block is rendered RTL.

drawRowWithElements

package

drawRowWithElements(row, cursorY, isRtl)

Draw debug rectangles for a non-empty row and all of its subcomponents.

Parameter

row

Blockly.blockRendering.Row

The non-empty row to render.

Value must not be null.

cursorY

number

The y position of the top of the row.

isRtl

boolean

Whether the block is rendered RTL.

drawSpacerElem

package

drawSpacerElem(elem, rowHeight, isRtl)

Draw a debug rectangle for a horizontal spacer.

Parameter

elem

Blockly.blockRendering.InRowSpacer

The spacer to render.

Value must not be null.

rowHeight

number

The height of the container row.

isRtl

boolean

Whether the block is rendered RTL.

drawSpacerRow

package

drawSpacerRow(row, cursorY, isRtl)

Draw a debug rectangle for a spacer (empty) row.

Parameter

row

Blockly.blockRendering.Row

The row to render.

Value must not be null.

cursorY

number

The y position of the top of the row.

isRtl

boolean

Whether the block is rendered RTL.