Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

fix: uvs array might change if the region is updated and the uvs are more #35

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

davidetan
Copy link
Contributor

The cacheData structure might hold an old uvs array when a region is updated.

The PR just always reassigns the current uvs to the cache.
The alternative would have been to check if the uvs length differs like this:

if (cacheData.uvs !== attachment.uvs)
{
    cacheData.uvs = attachment.uvs as Float32Array;
}

But the result would have been almost the same with an additional if check. In general uvs array changes very rarely, so in most of the case the if body would not have been executed.
I don't see any performance improvement in keeping that if, so I just removed it and kept only the assignment.

This fixes a bug reported by a user on discord: https://discord.com/channels/734147990985375826/968068622327111681/1270951771564675134

@Zyie Zyie merged commit d7a6c74 into pixijs:main Aug 22, 2024
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants