# Unnecessary paints

**URL:** <https://forum.juce.com/t/unnecessary-paints/19604>\
**Category:** General JUCE discussion\
**Created:** [October 24, 2016, 11:22am UTC](https://forum.juce.com/t/unnecessary-paints/19604 "2016-10-24T11:22:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jakob-2](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jakob-2/32/783_2.png) [@jakob-2](https://forum.juce.com/u/jakob-2)\
**Post date:** [October 24, 2016, 11:22am UTC](https://forum.juce.com/t/unnecessary-paints/19604/1 "2016-10-24T11:22:23Z")

</div>

I have a component A.

A has two child components AA and AB, which are both set to visible and have the same bounds. AB is on top of AA and AB is set to opaque.

AA has a child component AAA which is smaller than AA. A timer is constantly calling `AAA::repaint()`.

`AAA::paint` is not called. Which is great.

But `AB::paint` is called continuously. It repaints everything within the bounds of AAA. Why so? AB is set to opaque and fully covers AAA, so calling `AB::paint` seems unnecessary.

Tested with Windows 10.

Similar questions had been asked before, but for me they all seemed a bit different. Please excuse if this question is an unnecessary repetition.

---

<div class="post-metadata">

**Author:** ![jakemumu](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jakemumu/32/13038_2.png) [@jakemumu](https://forum.juce.com/u/jakemumu)\
**Post date:** [October 24, 2016, 11:39pm UTC](https://forum.juce.com/t/unnecessary-paints/19604/2 "2016-10-24T23:39:43Z")

</div>

ohh lordie here we go again lol

---

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [October 25, 2016, 9:04am UTC](https://forum.juce.com/t/unnecessary-paints/19604/3 "2016-10-25T09:04:10Z")

</div>

You are right. If a component is fully covered by another opaque component, i think it should not repainted, even when its repaint method is called. I think you are right.

But (by experience) if you really want to gets this fixed, you need to invest time, post an example code, and a possible fix.

PS: there is one exception, if the underlying components border shares the exact same border with its overlaying component and both are transformed with a fractional number
