blockly > utils > dom > getTextWidth

utils.dom.getTextWidth() 函数

获取文本元素的宽度,并在进程中进行缓存。

Signature:

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

参数

参数 类型 说明
textElement SVGTextElement SVG“文字”元素。

返回

number

元素的宽度。