Fix high CPU load in grid customizer (GH9060) #9066
Merged
+0
−2
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.
Ensure the animation layer paint is called at least once inside paintComponent so that the animation timer is shut down.
This is a minimal fix for #9060. If a change is made that triggers no change in bounds, then
animationwas set tofalse. However, if an existing animation was active at that time, the animation layer timer isn't stopped becauseanimLayer.paint(..)isn't called during repaint. This causes a doom loop of repaint requests with excessive CPU usage.This whole animation layer code is a little suspect - ideally it would exit cleanly during the timer listener - but it doesn't seem worth doing a full refactor for a little used feature.
Fixes #9060