# setOpaque & parent

**URL:** <https://forum.juce.com/t/setopaque-parent/41590>\
**Category:** General JUCE discussion\
**Created:** [September 4, 2020, 2:19am UTC](https://forum.juce.com/t/setopaque-parent/41590 "2020-09-04T02:19:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![finecutbodies](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/finecutbodies/32/26_2.png) [@finecutbodies](https://forum.juce.com/u/finecutbodies)\
**Post date:** [September 4, 2020, 2:19am UTC](https://forum.juce.com/t/setopaque-parent/41590/1 "2020-09-04T02:19:38Z")

</div>

Is this the normal behavior and I just miss something why it’s important to happen this way?

1, I set a child component to opaque and continuously repaint it.  
2, The parent component’s paint method also continuously get called (although with clipBounds to the opaque child)  
3, the grandParent’s paint() won’t be called (and that’s good).

That’s quite strange as I would think the parent component’s paint() shouldn’t be called, especially not with the clipBounds of it’s child component that is opaque (why would a parent paint behind the opaque child?). Also there can be a lot of calculations in the parent component’s paint method that shouldn’t happen even if the clip region won’t paint it.

---

<div class="post-metadata">

**Author:** ![lalala](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/lalala/32/8577_2.png) [@lalala](https://forum.juce.com/u/lalala)\
**Post date:** [September 4, 2020, 3:33pm UTC](https://forum.juce.com/t/setopaque-parent/41590/2 "2020-09-04T15:33:06Z")

</div>

have you called `setPaintingIsUnclipped (true)` on your child component?

> [@Unnecessary paints when parent is setPaintingIsUnclipped](https://forum.juce.com/t/unnecessary-paints-when-parent-is-setpaintingisunclipped/19913):
>
> I have 2 components : A and its child AA, both are opaque and setPaintingIsUnclipped (true). Everytime AA is repainted, the parent A is also repainted. Any reason for that? (If the parent is not setPaintingIsUnclipped, everything is ok) here is a simple code to reproduce (basic MainComponent for a projucer generated gui app) tested on 10.12 #ifndef MAINCOMPONENT\_H\_INCLUDED #define MAINCOMPONENT\_H\_INCLUDED #include "../JuceLibraryCode/JuceHeader.h" class ChildComponent : public Component, p…

---

<div class="post-metadata">

**Author:** ![finecutbodies](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/finecutbodies/32/26_2.png) [@finecutbodies](https://forum.juce.com/u/finecutbodies)\
**Post date:** [September 4, 2020, 6:56pm UTC](https://forum.juce.com/t/setopaque-parent/41590/3 "2020-09-04T18:56:58Z")

</div>

Thanks for the idea, I understand how that would make it a needed repaint, but no I didn’t.

---

<div class="post-metadata">

**Author:** ![lalala](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/lalala/32/8577_2.png) [@lalala](https://forum.juce.com/u/lalala)\
**Post date:** [September 4, 2020, 7:11pm UTC](https://forum.juce.com/t/setopaque-parent/41590/4 "2020-09-04T19:11:29Z")

</div>

> [@finecutbodies](#):
>
> I understand how that would make it a needed repaint

I don’t 🙂 the link above was a bug report.  
But yes, your issue is different then.
