# Painting under animated component

**URL:** <https://forum.juce.com/t/painting-under-animated-component/8116>\
**Category:** General JUCE discussion\
**Created:** [February 12, 2012, 9:46am UTC](https://forum.juce.com/t/painting-under-animated-component/8116 "2012-02-12T09:46:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shlomi](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/shlomi/32/99_2.png) [@Shlomi](https://forum.juce.com/u/Shlomi)\
**Post date:** [February 12, 2012, 9:46am UTC](https://forum.juce.com/t/painting-under-animated-component/8116/1 "2012-02-12T09:46:54Z")

</div>

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.

Thanks

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [February 12, 2012, 12:48pm UTC](https://forum.juce.com/t/painting-under-animated-component/8116/2 "2012-02-12T12:48:46Z")

</div>

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.
