Fix GridRenderer hygiene#6000
Open
kwvanderlinde wants to merge 6 commits into
Open
Conversation
Contributor
|
Sounds like this will also fix: #5758 |
Collaborator
Author
Aside from `#gridColours`, static state is no longer used `GridRenderer`. This prevents one `GridRenderer` for one `Zone` from affecting another `GridRenderer` for another `Zone`. In `#onGridChanged()`, do not reassign `#zone`, but only action the event if the zone matches. Before this, changing a grid on one zone would result in the GridRenderer state being invalid for its original zone.
5e67bcf to
3acecf9
Compare
`Grid#draw()` and `Grid#drawCoordinatesOverlay()` are no longer used and have been removed (along with much other unused Grid functionality).
It is not costly to recreate the colours. This avoids the event bus in the renderer and means there is no chance of keeping the wrong state around.
3acecf9 to
cc367b8
Compare
bubblobill
approved these changes
Jul 8, 2026
bubblobill
left a comment
Collaborator
There was a problem hiding this comment.
Apart from my personal dislike for final classes, this all appears sensible.
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.
Identify the Bug or Feature request
Fixes issue with PR #5581
Progresses #3691
Fixes #5758
Description of the Change
Fixes a bug where modifying a grid in one zone forces all other zones to start rendering the modified zone's grid. This is done by not reassigning
GridRenderer#zonein response toGridChangedevents.GridRendererno longer uses static state to track changing variables. This avoids the need to invokeGridRendererandGridmethods in specific orders just to get the state to be correct.In order to allow
gridColoursto not be static anymore, theGridRendererno directly draws the grid and coordinates rather than delegating toGrid#draw()(which would then delegate back toGridRenderer). Lots of unused code was removed fromGridclasses, some related to this change some that was just sitting around.Possible Drawbacks
Should be none.
Documentation Notes
N/A
Release Notes
N/A
This change is