Painting under animated component

I have a big component with a heavy paint() and I have a small component on top of it that it being animated.
My heavy paint() is being called constantly during the animation.

Is there a way for me in Juce to reduce the heavy painting during the animation or that I have to create an internal cache inside the paint method?
I tried using setBufferedToImage() on the large component but I seems to be invalidated during the animation.


If the animated component is a child of the one that is buffered, then yes, the buffer will be invalidated when its child moves.

…but if you make the buffered component a sibling of the animated one, then the buffering should work the way you want.