# Child extend beyond bounds of parent?

**URL:** <https://forum.juce.com/t/child-extend-beyond-bounds-of-parent/27230>\
**Category:** General JUCE discussion\
**Created:** [April 14, 2018, 9:04am UTC](https://forum.juce.com/t/child-extend-beyond-bounds-of-parent/27230 "2018-04-14T09:04:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jnicol](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jnicol/32/1532_2.png) [@jnicol](https://forum.juce.com/u/jnicol)\
**Post date:** [April 14, 2018, 9:04am UTC](https://forum.juce.com/t/child-extend-beyond-bounds-of-parent/27230/1 "2018-04-14T09:04:34Z")

</div>

Can a child component extend beyond the bounds of its parent? For example if a component is 100x100px, can one of its children be 200x200px and entirely visible, or will it always be clipped to the size of its parent?

This sounds like a really basic thing to know, but I couldn’t find anything relevant in the docs or forum. Thanks!

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daniel/32/790_2.png) [@daniel](https://forum.juce.com/u/daniel)\
**Post date:** [April 14, 2018, 9:35am UTC](https://forum.juce.com/t/child-extend-beyond-bounds-of-parent/27230/2 "2018-04-14T09:35:11Z")

</div>

In general the painting it is cropped.  
You can disable that using [Component::setPaintingIsUnclipped()](https://docs.juce.com/develop/classComponent.html#afd2216ecd5029923097d6baabab400ec), but the update mechanism will not catch the artefacts you created outside, so it is a bad idea.

---

<div class="post-metadata">

**Author:** ![jnicol](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jnicol/32/1532_2.png) [@jnicol](https://forum.juce.com/u/jnicol)\
**Post date:** [April 14, 2018, 9:44am UTC](https://forum.juce.com/t/child-extend-beyond-bounds-of-parent/27230/3 "2018-04-14T09:44:03Z")

</div>

Good to know. So I assume that typically people don’t nest components with large dimensions inside components with smaller dimensions?

For context, I have a small component containing a button that will reveal a second component that fills the plugin stage (basically a modal for displaying plugin options). It sounds like that modal component can’t be a child of its smaller parent, in which case I will just move it higher up the component hierarchy.

---

<div class="post-metadata">

**Author:** ![Toddler-Boy](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/toddler-boy/32/2007_2.png) [@Toddler-Boy](https://forum.juce.com/u/Toddler-Boy)\
**Post date:** [April 14, 2018, 4:22pm UTC](https://forum.juce.com/t/child-extend-beyond-bounds-of-parent/27230/4 "2018-04-14T16:22:07Z")

</div>

You mean like a CallOutBox?

[https://docs.juce.com/master/classCallOutBox.html](https://docs.juce.com/master/classCallOutBox.html)

---

<div class="post-metadata">

**Author:** ![jnicol](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jnicol/32/1532_2.png) [@jnicol](https://forum.juce.com/u/jnicol)\
**Post date:** [April 14, 2018, 8:21pm UTC](https://forum.juce.com/t/child-extend-beyond-bounds-of-parent/27230/5 "2018-04-14T20:21:24Z")

</div>

CallOutBox could theoretically work. My component is designed to fill the plugin stage completely (modal was possibly an inaccurate term to use), but it sounds as if CallOutBox could be twisted to that purpose by positioning it at 0,0 and giving making it the width and height of the plugin.

I have gone ahead and moved my component higher up the component tree so that it sits within a full width & height parent, but it is good to know about CallOutBox for the future.
