Files
il/resources/public/js/cljs-runtime/module$node_modules$pixi_DOT_js$lib$scene$mesh_plane$MeshPlane.js
2026-07-01 22:38:29 -06:00

36 lines
1.6 KiB
JavaScript

shadow$provide.module$node_modules$pixi_DOT_js$lib$scene$mesh_plane$MeshPlane = function(global, require, module, exports) {
var definedProps = require("module$node_modules$pixi_DOT_js$lib$scene$container$utils$definedProps");
global = require("module$node_modules$pixi_DOT_js$lib$scene$mesh$shared$Mesh");
var PlaneGeometry = require("module$node_modules$pixi_DOT_js$lib$scene$mesh_plane$PlaneGeometry");
"use strict";
class MeshPlane extends global.Mesh {
constructor(options) {
const {texture, verticesX, verticesY, ...rest} = options;
options = new PlaneGeometry.PlaneGeometry(definedProps.definedProps({width:texture.width, height:texture.height, verticesX, verticesY}));
super(definedProps.definedProps({...rest, geometry:options, texture}));
this.texture = texture;
this.autoResize = !0;
}
textureUpdated() {
const geometry = this.geometry, {width, height} = this.texture;
!this.autoResize || geometry.width === width && geometry.height === height || (geometry.width = width, geometry.height = height, geometry.build({}));
}
set texture(value) {
this._texture?.off("update", this.textureUpdated, this);
super.texture = value;
value.on("update", this.textureUpdated, this);
this.textureUpdated();
}
get texture() {
return this._texture;
}
destroy(options) {
this.texture.off("update", this.textureUpdated, this);
super.destroy(options);
}
}
exports.MeshPlane = MeshPlane;
};
//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$scene$mesh_plane$MeshPlane.js.map