Skip to content

NinePatch should rebuild after atlas resize/rebuild#2736

Merged
einarf merged 3 commits intodevelopmentfrom
ninepatch-dirty-fix
Jun 23, 2025
Merged

NinePatch should rebuild after atlas resize/rebuild#2736
einarf merged 3 commits intodevelopmentfrom
ninepatch-dirty-fix

Conversation

@einarf
Copy link
Member

@einarf einarf commented Jun 23, 2025

No description provided.

@einarf einarf requested a review from Copilot June 23, 2025 18:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 _version attribute and version property in the base atlas class
  • Increment _version on 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 _version increments correctly after a resize or rebuild. Adding unit tests for resize and rebuild would help catch regressions.
        self._version += 1

@einarf einarf merged commit 94df796 into development Jun 23, 2025
7 checks passed
@einarf einarf deleted the ninepatch-dirty-fix branch June 23, 2025 19:03
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.

2 participants