Skip to content

Commit

Permalink
Fix Text updates to remove recursive transform update (pixijs#8314)
Browse files Browse the repository at this point in the history
  • Loading branch information
dev7355608 committed May 4, 2022
1 parent 3258470 commit b8754e3
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions packages/text/src/Text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,9 +431,6 @@ export class Text extends Sprite

texture.updateUvs();

// Recursively updates transform of all objects from the root to this one
this._recursivePostUpdateTransform();

this.dirty = false;
}

Expand All @@ -455,6 +452,27 @@ export class Text extends Sprite
super._render(renderer);
}

/** Updates the transform on all children of this container for rendering. */
public updateTransform(): void
{
this.updateText(true);

super.updateTransform();
}

public getBounds(skipUpdate?: boolean, rect?: Rectangle): Rectangle
{
this.updateText(true);

if (this._textureID === -1)
{
// texture was updated: recalculate transforms
skipUpdate = false;
}

return super.getBounds(skipUpdate, rect);
}

/**
* Gets the local bounds of the text object.
*
Expand All @@ -471,7 +489,6 @@ export class Text extends Sprite
/** Calculates the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. */
protected _calculateBounds(): void
{
this.updateText(true);
this.calculateVertices();
// if we have already done this on THIS frame.
this._bounds.addQuad(this.vertexData);
Expand Down

0 comments on commit b8754e3

Please sign in to comment.