Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_onTextureUpdate()
{
this._textureID = -1;
this._textureTrimmedID = -1;
this._cachedTint = 0xFFFFFF;
// so if _width is 0 then width was not set..
if (this._width)
{
this.scale.x = sign(this.scale.x) * this._width / this._texture.orig.width;
}
if (this._height)
{
this.scale.y = sign(this.scale.y) * this._height / this._texture.orig.height;
}
}
set height(value) // eslint-disable-line require-jsdoc
{
this.updateText(true);
const s = sign(this.scale.y) || 1;
this.scale.y = s * value / this._texture.orig.height;
this._height = value;
}
_onTextureUpdate()
{
this._textureID = -1;
this._textureTrimmedID = -1;
this._cachedTint = 0xFFFFFF;
// so if _width is 0 then width was not set..
if (this._width)
{
this.scale.x = sign(this.scale.x) * this._width / this._texture.orig.width;
}
if (this._height)
{
this.scale.y = sign(this.scale.y) * this._height / this._texture.orig.height;
}
}
set height(value) // eslint-disable-line require-jsdoc
{
const s = sign(this.scale.y) || 1;
this.scale.y = s * value / this._texture.orig.height;
this._height = value;
}
set width(value) // eslint-disable-line require-jsdoc
{
const s = sign(this.scale.x) || 1;
this.scale.x = s * value / this._texture.orig.width;
this._width = value;
}
set width(value) // eslint-disable-line require-jsdoc
{
this.updateText(true);
const s = sign(this.scale.x) || 1;
this.scale.x = s * value / this._texture.orig.width;
this._width = value;
}
set height(value) // eslint-disable-line require-jsdoc
{
this.updateText(true);
const s = sign(this.scale.y) || 1;
this.scale.y = s * value / this._texture.orig.height;
this._height = value;
}
set height(value) // eslint-disable-line require-jsdoc
{
const s = sign(this.scale.y) || 1;
this.scale.y = s * value / this._texture.orig.height;
this._height = value;
}
_onTextureUpdate()
{
this._textureID = -1;
this._textureTrimmedID = -1;
this.cachedTint = 0xFFFFFF;
// so if _width is 0 then width was not set..
if (this._width)
{
this.scale.x = sign(this.scale.x) * this._width / this._texture.orig.width;
}
if (this._height)
{
this.scale.y = sign(this.scale.y) * this._height / this._texture.orig.height;
}
}