Fix button highlighting bugs and optimize memory for Raspberry Pi CM5 #337
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.
Description
This PR addresses button highlighting issues and introduces memory efficiency optimizations targeted for the Raspberry Pi CM5.
Changes
fix: Remove broken static tile cache causing button highlighting bugs
The static cache optimization in Layer::Rectangle() was fundamentally broken - static variables persisted across all rendering calls, causing stale cache values to be used when different buttons needed different textures.
fix: Preload all textures to fix button highlighting bug
The lazy texture loading optimization conflicted with the static tile cache in Layer::Rectangle(), causing buttons to incorrectly show highlighted state.
perf: Add memory efficiency optimizations for Raspberry Pi CM5
Object Pool System:
Thread Pool & Async I/O:
Memory Management Improvements:
Quick Fixes:
Target: Raspberry Pi CM5 with 2GB RAM optimization
Tests: 83/83 passing
Testing
All tests pass (83/83). Manual testing on Raspberry Pi CM5 recommended for memory optimizations.