diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 28b0b18..121bf58 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -212,11 +212,11 @@ } else { - w0 = orig.width * (1 - anchor._x); - w1 = orig.width * -anchor._x; + w1 = -anchor._x * orig.width; + w0 = w1 + orig.width; - h0 = orig.height * (1 - anchor._y); - h1 = orig.height * -anchor._y; + h1 = -anchor._y * orig.height; + h0 = h1 + orig.height; } // xy @@ -269,11 +269,11 @@ const tx = wt.tx; const ty = wt.ty; - const w0 = (orig.width) * (1 - anchor._x); - const w1 = (orig.width) * -anchor._x; + const w1 = -anchor._x * orig.width; + const w0 = w1 + orig.width; - const h0 = orig.height * (1 - anchor._y); - const h1 = orig.height * -anchor._y; + const h1 = -anchor._y * orig.height; + const h0 = h1 + orig.height; // xy vertexData[0] = (a * w1) + (c * h1) + tx; @@ -440,7 +440,7 @@ * * @static * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from - * @return {PIXI.Sprite} The newly created texture + * @return {PIXI.Sprite} The newly created sprite */ static from(source) { @@ -538,8 +538,8 @@ } /** - * The tint applied to the sprite. This is a hex value. A value of - * 0xFFFFFF will remove any tint effect. + * The tint applied to the sprite. This is a hex value. + * A value of 0xFFFFFF will remove any tint effect. * * @member {number} * @default 0xFFFFFF