# Does VBlankAttachment cause repaint whole parent component?

**URL:** <https://forum.juce.com/t/does-vblankattachment-cause-repaint-whole-parent-component/64184>\
**Category:** General JUCE discussion\
**Created:** [November 12, 2024, 10:22pm UTC](https://forum.juce.com/t/does-vblankattachment-cause-repaint-whole-parent-component/64184 "2024-11-12T22:22:22Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![stephenk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/stephenk/32/15198_2.png) [@stephenk](https://forum.juce.com/u/stephenk)\
**Post date:** [November 16, 2024, 7:57pm UTC](https://forum.juce.com/t/does-vblankattachment-cause-repaint-whole-parent-component/64184/8 "2024-11-16T19:57:03Z")

</div>

> [@aamf](#):
>
> how did you find out that the rectangle in between was being refreshed?

@aamf - It was a while ago, but from some notes I made at the time:

I was able to prove this by putting this code in ComponentPeer::handlePaint(), in the JUCE\_ENABLE\_REPAINT\_DEBUGGING section right after the g.FillAll(), to show the bounds of the clipRectangle. (JUCE\_ENABLE\_REPAINT\_DEBUGGING must be enabled, but you can comment out the g.FillAll())

```auto
    // TEMPORARY_EDIT
    auto r = g.getClipBounds();
    std::cerr << String::formatted("bounds x %03d, y %03d, w %03d, h %03d", 
			r.getX(), r.getY(), r.getWidth(), r. getHeight()) << "\n";

```

This lets us see the actual regions that are called to repaint, which JUCE\_ENABLE\_REPAINT\_DEBUGGING does not display correctly.

See also:

> [@Mac OSX: painting two small child components far apart invalidates entire area between](https://forum.juce.com/t/mac-osx-painting-two-small-child-components-far-apart-invalidates-entire-area-between/46584):
>
> I have two “flashing LEDs” - one in the upper left is a Tempo LED that blinks on the beat, while tiny ones in the lower right are Pattern LEDs that track the steps of a pattern through a step-editing grid. As the Pattern LEDs are being driven by some subdivision of the tempo, they blink/change more often than the Tempo Led, like 4:1 as an example. What happens is that when the the Tempo LED and a Pattern LED happen to execute a paint at the same time, even though one is in the upper left and o…

---

_[View the full topic](https://forum.juce.com/t/does-vblankattachment-cause-repaint-whole-parent-component/64184)._
