Changed types to work with new paint event handler.