I’m running into some CPU issues with repainting and hope that anyone could help
I have a small MIDI activity LED Component. It sets a “needs repaint” flag when it receives a MIDI event. The LED component checks the flag using a
Timer, and calls
repaint() if needed.
The LED has
setOpaque(true). [EDIT] The issue occurs no matter if I call
setPaintingIsUnclipped or not.
When the LED calls
repaint(), it goes into
internalRepaintUnchecked, and then, without checking for opacity, straight into
I’ve set breakpoints in the
paint() method of my background component. It’s getting called repeatedly, and the clip region seems to be the area below the LED. I might be missing something, but considering the LED is opaque, why is the parent being repainted?
Another thing I noticed is that if two small Components need to be repainted, and they are in two opposite corners of the UI, JUCE repaints almost the entire background, and not just the small areas below each of the two Components. Is this intended?