# Wondering about setPaintingIsUnclipped()

**URL:** <https://forum.juce.com/t/wondering-about-setpaintingisunclipped/6176>\
**Category:** General JUCE discussion\
**Created:** [January 10, 2011, 2:06pm UTC](https://forum.juce.com/t/wondering-about-setpaintingisunclipped/6176 "2011-01-10T14:06:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheVinn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thevinn/32/806_2.png) [@TheVinn](https://forum.juce.com/u/TheVinn)\
**Post date:** [January 10, 2011, 2:06pm UTC](https://forum.juce.com/t/wondering-about-setpaintingisunclipped/6176/1 "2011-01-10T14:06:56Z")

</div>

I’m using setPaintingIsUnclipped(), and I am definitely drawing within my bounds, but what I am seeing is that if a parent component has setPaintingIsUnclipped(true), it is possible for child components to draw outside the parent’s bounds.

For example, I have a button in the corner of its parent Component with bounds = (-2, 0, 32, 16). The reason I put it at x coordinate -2 is so that its frame will not be visible. The both Component have setPaintingIsUnclipped(true), I am only drawing within the bounds, but the child is not getting clipped to the parent’s bounds.

So I guess what I am asking, is it expected behavior that when setPaintingIsUnclipped is true, child Components can draw outside their parent’s bounds?

---

<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:** [January 10, 2011, 2:51pm UTC](https://forum.juce.com/t/wondering-about-setpaintingisunclipped/6176/2 "2011-01-10T14:51:52Z")

</div>

I knew I should never have made that method public. No, it won’t clip it’s children.

Why are you using it anyway? My advice is to leave it alone.

---

<div class="post-metadata">

**Author:** ![TheVinn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thevinn/32/806_2.png) [@TheVinn](https://forum.juce.com/u/TheVinn)\
**Post date:** [January 10, 2011, 3:15pm UTC](https://forum.juce.com/t/wondering-about-setpaintingisunclipped/6176/3 "2011-01-10T15:15:36Z")

</div>

It seems to be working with the exception of this one button. My window is a little bit slow to resize and scroll things and it needs all the help it can get. I’m making a lot of use of partially transparent stroked paths, transparent shading, gradient fills, etc…

---

<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:** [January 10, 2011, 4:13pm UTC](https://forum.juce.com/t/wondering-about-setpaintingisunclipped/6176/4 "2011-01-10T16:13:03Z")

</div>

Well, good luck with it, though it seems unlikely that it’d be any help unless you have a really huge number of unclipped components inside the same parent. I wrote it for Drawables where there might be hundreds of DrawablePath objects making up an image - it certainly wasn’t designed for anything more complex than a simple drawable.
