Box visibility optimizations - do not draw invisible backgrounds and
replaced boxes