Fix a bug of text elements not being rendered

Make sure to apply the painter once the painter has been processed