Repository: pixijs/pixijs
File: src/scene/text/canvas/CanvasTextPipe.ts (TypeScript)

Code before:
    } as const;

    private _renderer: Renderer;

    private _gpuText: Record<number, {
        texture: Texture,
        currentKey: string,
        batchableSprite: BatchableSprite,
    }> = Object.create(null);

    constructor(renderer: Renderer)
    {
        this._renderer = renderer;
        this._renderer.runners.resolutionChange.add(this);
    }

    public resolutionChange()
    {
        for (const i in this._gpuText)
        {
            const gpuText = this._gpuText[i];
            const text = gpuText.batchableSprite.renderable as Text;

            text._resolution = text._autoResolution ? this._renderer.resolution : text.resolution;
            text.onViewUpdate();
        }
    }

    public validateRenderable(text: Text): boolean
    {
        const gpuText = this._getGpuText(text);

        const newKey = text._getKey();

        if (gpuText.currentKey !== newKey)
        {
            const { width, height } = this._renderer.canvasText.getTextureSize(
                text.text,
                text.resolution,
                text._style,
            );

            if (
                // is only being used by this text:
                this._renderer.canvasText.getReferenceCount(gpuText.currentKey) === 1
                // check the size of the text is the same po2
                && width === gpuText.texture._source.width
                && height === gpuText.texture._source.height
            )
            {
                return false;

Review comment (suggestion):
can make the same change here too!

```
if(text._autoResolution)
{
    // will trigger on viewUpdate
    text.resolution = this.renderer.resolution
}
```

Code after:
    } as const;

    private _renderer: Renderer;

    private _gpuText: Record<number, {
        texture: Texture,
        currentKey: string,
        batchableSprite: BatchableSprite,
    }> = Object.create(null);

    constructor(renderer: Renderer)
    {
        this._renderer = renderer;
        this._renderer.runners.resolutionChange.add(this);
    }

    public resolutionChange()
    {
        for (const i in this._gpuText)
        {
            const gpuText = this._gpuText[i];
            const text = gpuText.batchableSprite.renderable as Text;

            if (text._autoResolution)
            {
                text._resolution = this._renderer.resolution;
                text.onViewUpdate();
            }
        }
    }

    public validateRenderable(text: Text): boolean
    {
        const gpuText = this._getGpuText(text);

        const newKey = text._getKey();

        if (gpuText.currentKey !== newKey)
        {
            const { width, height } = this._renderer.canvasText.getTextureSize(
                text.text,
                text.resolution,
                text._style,
            );

            if (
                // is only being used by this text:
                this._renderer.canvasText.getReferenceCount(gpuText.currentKey) === 1
                // check the size of the text is the same po2
                && width === gpuText.texture._source.width
                && height === gpuText.texture._source.height