Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants