diff --git a/modules/juce_gui_basics/components/juce_Component.cpp b/modules/juce_gui_basics/components/juce_Component.cpp index dab9d6dbc8..0d3b4dfd42 100644 --- a/modules/juce_gui_basics/components/juce_Component.cpp +++ b/modules/juce_gui_basics/components/juce_Component.cpp @@ -1997,7 +1997,7 @@ void Component::paintComponentAndChildren (Graphics& g) { auto clipBounds = g.getClipBounds(); - if (flags.dontClipGraphicsFlag) + if (flags.dontClipGraphicsFlag && getNumChildComponents() == 0) { paint (g); } diff --git a/modules/juce_gui_basics/components/juce_Component.h b/modules/juce_gui_basics/components/juce_Component.h index c721a4292f..cd3b5b676f 100644 --- a/modules/juce_gui_basics/components/juce_Component.h +++ b/modules/juce_gui_basics/components/juce_Component.h @@ -1113,10 +1113,10 @@ public: number of simple components being rendered, and where they are guaranteed never to do any drawing beyond their own boundaries, setting this to true will reduce the overhead involved in clipping the graphics context that gets passed to the component's paint() callback. + If you enable this mode, you'll need to make sure your paint method doesn't call anything like Graphics::fillAll(), and doesn't draw beyond the component's bounds, because that'll produce - artifacts. Your component also can't have any child components that may be placed beyond its - bounds. + artifacts. This option will have no effect on components that contain any child components. */ void setPaintingIsUnclipped (bool shouldPaintWithoutClipping) noexcept;