Better handling of applyShadow