shadow$provide.module$node_modules$pixi_DOT_js$lib$scene$text_html$utils$measureHtmlText = function(global, require, module, exports) { var HTMLTextRenderData = require("module$node_modules$pixi_DOT_js$lib$scene$text_html$HTMLTextRenderData"); "use strict"; let tempHTMLTextRenderData; exports.measureHtmlText = function(text, style, fontStyleCSS, htmlTextRenderData) { htmlTextRenderData || (htmlTextRenderData = tempHTMLTextRenderData || (tempHTMLTextRenderData = new HTMLTextRenderData.HTMLTextRenderData())); const {domElement, styleElement, svgRoot} = htmlTextRenderData; domElement.innerHTML = `
${text}
`; domElement.setAttribute("style", "transform-origin: top left; display: inline-block"); fontStyleCSS && (styleElement.textContent = fontStyleCSS); document.body.appendChild(svgRoot); text = domElement.scrollWidth; fontStyleCSS = domElement.scrollHeight; svgRoot.remove(); if (style.dropShadow) { const {distance, angle, blur} = style.dropShadow; htmlTextRenderData = Math.abs(Math.round(Math.sin(angle) * distance)); text += Math.abs(Math.round(Math.cos(angle) * distance)) + blur; fontStyleCSS += htmlTextRenderData + blur; } style = 2 * style.padding; return {width:text - style, height:fontStyleCSS - style}; }; }; //# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$scene$text_html$utils$measureHtmlText.js.map