blockly > utils > dom > getTextWidth

utils.dom.getTextWidth() function

Gets the width of a text element, caching it in the process.

Signature:

export declare function getTextWidth(textElement: SVGTextElement): number;

Parameters

Parameter Type Description
textElement SVGTextElement An SVG 'text' element.

Returns:

number

Width of element.