You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Fix map reloading when a technology is added (#14623)
* Fix map reloading when a technology is added
When adding a technology using edit mode, or when navigating through the game history and passing a point where a tech has been added with or without edit mode, the map will reload . On fast machines, this takes a fraction of a second. On slow machines, this might take longer. In either case, it's definitely noticeable.
Removing this line makes sure the map does not get redrawn entirely. Any changes should still be reflected on the map.
* Clarify repaint scope in inner class
Replace implicit repaint() call with explicit MapPanel.this::repaint
Inside the inner class, repaint() was previously called via a lambda:
SwingUtilities.invokeLater(() -> repaint());
While correct, this relies on implicit scope resolution and can be ambiguous in nested class contexts.
This change makes the target explicit:
SwingUtilities.invokeLater(MapPanel.this::repaint);
This improves readability and avoids confusion between inner class scope and the enclosing MapPanel instance.
No behavioral changes.
* Hide update behind feature flag
Hides the update behind a feature flag, so that people can safely test it for bugs.