33 lines
1.5 KiB
JavaScript
33 lines
1.5 KiB
JavaScript
shadow$provide.module$node_modules$pixi_DOT_js$lib$scene$text_html$HTMLTextRenderData = function(global, require, module, exports) {
|
|
var adapter = require("module$node_modules$pixi_DOT_js$lib$environment$adapter");
|
|
"use strict";
|
|
class HTMLTextRenderData {
|
|
constructor() {
|
|
this.svgRoot = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
this.foreignObject = document.createElementNS("http://www.w3.org/2000/svg", "foreignObject");
|
|
this.domElement = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
|
|
this.styleElement = document.createElementNS("http://www.w3.org/1999/xhtml", "style");
|
|
const {foreignObject, svgRoot, styleElement, domElement} = this;
|
|
foreignObject.setAttribute("width", "10000");
|
|
foreignObject.setAttribute("height", "10000");
|
|
foreignObject.style.overflow = "hidden";
|
|
svgRoot.appendChild(foreignObject);
|
|
foreignObject.appendChild(styleElement);
|
|
foreignObject.appendChild(domElement);
|
|
this.image = adapter.DOMAdapter.get().createImage();
|
|
}
|
|
destroy() {
|
|
this.svgRoot.remove();
|
|
this.foreignObject.remove();
|
|
this.styleElement.remove();
|
|
this.domElement.remove();
|
|
this.image.src = "";
|
|
this.image.remove();
|
|
this.canvasAndContext = this.image = this.domElement = this.styleElement = this.foreignObject = this.svgRoot = null;
|
|
}
|
|
}
|
|
exports.HTMLTextRenderData = HTMLTextRenderData;
|
|
};
|
|
|
|
//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$scene$text_html$HTMLTextRenderData.js.map
|