27 lines
2.0 KiB
JavaScript
27 lines
2.0 KiB
JavaScript
shadow$provide.module$node_modules$pixi_DOT_js$lib$scene$container$container_mixins$measureMixin = function(global, require, module, exports) {
|
|
global = require("module$node_modules$pixi_DOT_js$lib$maths$matrix$Matrix");
|
|
var Bounds = require("module$node_modules$pixi_DOT_js$lib$scene$container$bounds$Bounds"), getGlobalBounds = require("module$node_modules$pixi_DOT_js$lib$scene$container$bounds$getGlobalBounds"), getLocalBounds = require("module$node_modules$pixi_DOT_js$lib$scene$container$bounds$getLocalBounds"), checkChildrenDidChange = require("module$node_modules$pixi_DOT_js$lib$scene$container$utils$checkChildrenDidChange");
|
|
"use strict";
|
|
const tempMatrix = new global.Matrix();
|
|
exports.measureMixin = {_localBoundsCacheId:-1, _localBoundsCacheData:null, _setWidth(value, localWidth) {
|
|
const sign = Math.sign(this.scale.x) || 1;
|
|
this.scale.x = 0 !== localWidth ? value / localWidth * sign : sign;
|
|
}, _setHeight(value, localHeight) {
|
|
const sign = Math.sign(this.scale.y) || 1;
|
|
this.scale.y = 0 !== localHeight ? value / localHeight * sign : sign;
|
|
}, getLocalBounds() {
|
|
this._localBoundsCacheData || (this._localBoundsCacheData = {data:[], index:1, didChange:!1, localBounds:new Bounds.Bounds()});
|
|
const localBoundsCacheData = this._localBoundsCacheData;
|
|
localBoundsCacheData.index = 1;
|
|
localBoundsCacheData.didChange = !1;
|
|
localBoundsCacheData.data[0] !== this._didViewChangeTick && (localBoundsCacheData.didChange = !0, localBoundsCacheData.data[0] = this._didViewChangeTick);
|
|
checkChildrenDidChange.checkChildrenDidChange(this, localBoundsCacheData);
|
|
localBoundsCacheData.didChange && getLocalBounds.getLocalBounds(this, localBoundsCacheData.localBounds, tempMatrix);
|
|
return localBoundsCacheData.localBounds;
|
|
}, getBounds(skipUpdate, bounds) {
|
|
return getGlobalBounds.getGlobalBounds(this, skipUpdate, bounds || new Bounds.Bounds());
|
|
}};
|
|
};
|
|
|
|
//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$scene$container$container_mixins$measureMixin.js.map
|