Efficient Painting

You can optimise this using the
juce::Rectangle<int> visibleRect = g.getClipBounds().getIntersection(getLocalBounds());
in the paint function