# Only child component is clipped proportionally to used width

**URL:** <https://forum.juce.com/t/only-child-component-is-clipped-proportionally-to-used-width/59024>\
**Category:** General JUCE discussion\
**Created:** [December 1, 2023, 10:06pm UTC](https://forum.juce.com/t/only-child-component-is-clipped-proportionally-to-used-width/59024 "2023-12-01T22:06:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nezvers](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/nezvers/32/6896_2.png) [@nezvers](https://forum.juce.com/u/nezvers)\
**Post date:** [December 1, 2023, 10:06pm UTC](https://forum.juce.com/t/only-child-component-is-clipped-proportionally-to-used-width/59024/1 "2023-12-01T22:06:09Z")

</div>

I have a single Component that holds a FileBrowserComponent and resize to full bounds. Rest components removed to test behaviour.  
`void resized() override { fileBrowser.setBounds(getBounds()); };`  
But it is clipped.

![Juce component drawing bug](https://us1.discourse-cdn.com/flex026/uploads/juce/original/3X/9/a/9aa4301666edb8caccd53df84abf165da2fab878.gif)

I have no idea what could create such behaviour.

---

<div class="post-metadata">

**Author:** ![cpr2323](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/cpr2323/32/18682_2.png) [@cpr2323](https://forum.juce.com/u/cpr2323)\
**Post date:** [December 2, 2023, 1:01pm UTC](https://forum.juce.com/t/only-child-component-is-clipped-proportionally-to-used-width/59024/2 "2023-12-02T13:01:13Z")

</div>

> [@nezvers](#):
>
> void resized() override { fileBrowser.setBounds(getBounds()); };

I believe you want to use `getLocalBounds()`

---

<div class="post-metadata">

**Author:** ![nezvers](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/nezvers/32/6896_2.png) [@nezvers](https://forum.juce.com/u/nezvers)\
**Post date:** [December 2, 2023, 8:01pm UTC](https://forum.juce.com/t/only-child-component-is-clipped-proportionally-to-used-width/59024/3 "2023-12-02T20:01:13Z")

</div>

You are totally correct.  
Thank you a lot!
