NinePatch should rebuild after atlas resize/rebuild#2736
Merged
einarf merged 3 commits intodevelopmentfrom Jun 23, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a version counter to texture atlases and uses it in NinePatch geometry caching to ensure meshes are rebuilt after an atlas resize or rebuild.
- Introduce a
_versionattribute andversionproperty in the base atlas class - Increment
_versionon resize and rebuild in the default atlas implementation - Update NinePatch’s geometry cache key and type annotation to include
atlas.version
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| arcade/texture_atlas/base.py | Initialize _version and add a read-only version property |
| arcade/texture_atlas/atlas_default.py | Initialize _version, increment on resize and rebuild |
| arcade/gui/nine_patch.py | Expand geometry_cache to include atlas.version in cache key |
Comments suppressed due to low confidence (1)
arcade/texture_atlas/atlas_default.py:740
- There aren’t any tests verifying that
_versionincrements correctly after a resize or rebuild. Adding unit tests forresizeandrebuildwould help catch regressions.
self._version += 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.